1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-06-28 03:45:08 +03:00

Update init files for softetherd.

The check for an upstart configuration in the sysv script is reverted because
upstart and start-stop-daemon can both control the same softetherd instance.
This commit is contained in:
Darik Horn 2014-04-22 21:51:17 -04:00
parent 604b2b884f
commit 61d215e1c8
2 changed files with 8 additions and 19 deletions

13
debian/softether.init vendored
View File

@ -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

View File

@ -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