diff --git a/debian/softether.init b/debian/softether.init index 7109595e..064d92b6 100755 --- a/debian/softether.init +++ b/debian/softether.init @@ -11,6 +11,12 @@ set -e +if test -f /etc/init/softether.conf +then + echo "SoftEther is controlled by upstart." 1>&2 + exit 0 +fi + . /etc/default/softether case $SOFTETHER_MODE in diff --git a/debian/softether.upstart b/debian/softether.upstart new file mode 100644 index 00000000..84043c2c --- /dev/null +++ b/debian/softether.upstart @@ -0,0 +1,25 @@ +description "SoftEther VPN" + +start on started networking +stop on stoppping networking + +respawn +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 + ;; + (*) + exit 0 + ;; + esac +end script