diff --git a/debian/softether.init b/debian/softether.init index 064d92b6..cc7954c4 100755 --- a/debian/softether.init +++ b/debian/softether.init @@ -1,6 +1,6 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: softether-vpn +# Provides: softether # Required-Start: $local_fs $remote_fs $network $syslog $named # Required-Stop: $local_fs $remote_fs $network $syslog $named # Default-Start: 2 3 4 5 @@ -11,14 +11,11 @@ set -e -if test -f /etc/init/softether.conf +if test -f /etc/default/softether then - echo "SoftEther is controlled by upstart." 1>&2 - exit 0 + . /etc/default/softether fi -. /etc/default/softether - case $SOFTETHER_MODE in (vpnbridge) ;; @@ -34,11 +31,11 @@ esac case $1 in (start) start-stop-daemon --verbose --oknodo --start --background --exec \ - "/usr/sbin/$SOFTETHER_MODE" -- execsvc + /usr/sbin/softetherd -- "$SOFTETHER_MODE" ;; (stop) start-stop-daemon --verbose --oknodo --stop --exec \ - "/usr/sbin/$SOFTETHER_MODE" -- execsvc + /usr/sbin/softetherd -- "$SOFTETHER_MODE" ;; (restart) "$0" stop && "$0" start diff --git a/debian/softether.upstart b/debian/softether.upstart index 84043c2c..17a4fda9 100644 --- a/debian/softether.upstart +++ b/debian/softether.upstart @@ -9,17 +9,9 @@ expect stop script test -f /etc/default/softether && . /etc/default/softether case $SOFTETHER_MODE in - (vpnbridge) - exec /usr/sbin/vpnbridge upstart - ;; - (vpnclient) - exec /usr/sbin/vpnclient upstart - ;; - (vpnserver) - exec /usr/sbin/vpnserver upstart - ;; + (vpnbridge|vpnclient|vpnserver) + exec /usr/sbin/softetherd "$SOFTETHER_MODE" ;; (*) - exit 0 - ;; + exit 0 ;; esac end script