#!/bin/sh

##
# OpenVPN-Client
##


. /etc/rc.common

StartService()
{
        	ConsoleMessage "Starting OpenVPN-Client"
                /usr/local/sbin/openvpn --daemon --cd /etc/openvpn \
			--config /etc/openvpn/client.conf \
			--writepid /var/run/openvpn.pid
#        fi
}

StopService()
{
	pid=$(GetPID openvpn)   
	if [ $? = 0 ]; then
		ConsoleMessage "Stopping OpenVPN-Client"
		kill -TERM "${pid}"
	fi
}


RestartService () { StopService; StartService; }

RunService "$1"
