X-Git-Url: https://git.tld-linux.org/?p=packages%2Fopenvpn.git;a=blobdiff_plain;f=openvpn.init;h=ba4f5891f9a7cf73205aafb25733b6ee74d582d5;hp=9c47799074dcd379a8086b8d4fffcc68be93eedc;hb=HEAD;hpb=005d29067c8f1f75225446b1859b74f2f96fdf7d diff --git a/openvpn.init b/openvpn.init old mode 100644 new mode 100755 index 9c47799..ba4f589 --- a/openvpn.init +++ b/openvpn.init @@ -48,12 +48,6 @@ tunlsup() { } start() { - # Check if the service is already running? - if tunlsup; then - msg_already_running "OpenVPN" - return - fi - msg_starting "OpenVPN"; started for tun in $TUNNELS; do config="/etc/openvpn/$tun.conf" @@ -62,12 +56,8 @@ start() { fail RET=1 else - show "Starting OpenVPN tunnel %s" "$tun" - if tunlup $tun; then - started - continue - fi - + tunlup $tun && continue + show "Starting OpenVPN tunnel %s" "$tun"; busy daemon --pidfile /var/run/openvpn/$tun.pid /usr/sbin/openvpn --daemon --writepid /var/run/openvpn/$tun.pid \ --config $config --cd /etc/openvpn ${OPENVPN_OPT} RET=$? @@ -78,12 +68,6 @@ start() { } stop() { - if ! tunlsup; then - msg_not_running "OpenVPN" - return - fi - - # Stop daemons. msg_stopping "OpenVPN"; started for tun in $TUNNELS; do pidfile=/var/run/openvpn/$tun.pid @@ -91,6 +75,7 @@ stop() { pid=`cat "$pidfile"` show "Stopping OpenVPN tunnel %s" "$tun"; busy killproc --pidfile openvpn/$tun.pid || err=1 + rm -f $pidfile done rm -f /var/lock/subsys/openvpn >/dev/null 2>&1 } @@ -130,8 +115,6 @@ status() { RETVAL=$? } -upstart_controlled --except status - RETVAL=0 # See how we were called. case "$1" in