mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-06-28 20:05:08 +03:00
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.
47 lines
880 B
Bash
Executable File
47 lines
880 B
Bash
Executable File
#!/bin/sh
|
|
### BEGIN INIT INFO
|
|
# 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
|
|
# Default-Stop: 0 1 6
|
|
# X-Interactive: true
|
|
# Short-Description: Start/stop SoftEther VPN Server
|
|
### END INIT INFO
|
|
|
|
set -e
|
|
|
|
if test -f /etc/default/softether
|
|
then
|
|
. /etc/default/softether
|
|
fi
|
|
|
|
case $SOFTETHER_MODE in
|
|
(vpnbridge)
|
|
;;
|
|
(vpnclient)
|
|
;;
|
|
(vpnserver)
|
|
;;
|
|
(*)
|
|
exit 0
|
|
;;
|
|
esac
|
|
|
|
case $1 in
|
|
(start)
|
|
start-stop-daemon --verbose --oknodo --start --background --exec \
|
|
/usr/sbin/softetherd -- "$SOFTETHER_MODE"
|
|
;;
|
|
(stop)
|
|
start-stop-daemon --verbose --oknodo --stop --exec \
|
|
/usr/sbin/softetherd -- "$SOFTETHER_MODE"
|
|
;;
|
|
(restart)
|
|
"$0" stop && "$0" start
|
|
(*)
|
|
echo "error: Unknown command $1" 1>&2
|
|
exit 1
|
|
;;
|
|
esac
|