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

44 lines
835 B
Bash
Executable File

#!/bin/sh
### BEGIN INIT INFO
# Provides: softether-vpn
# 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
. /etc/default/softether
case $SOFTETHER_MODE in
(vpnbridge)
;;
(vpnclient)
;;
(vpnserver)
;;
(*)
exit 0
;;
esac
case $1 in
(start)
start-stop-daemon --verbose --oknodo --start --background --exec \
"/usr/sbin/$SOFTETHER_MODE" -- execsvc
;;
(stop)
start-stop-daemon --verbose --oknodo --stop --exec \
"/usr/sbin/$SOFTETHER_MODE" -- execsvc
;;
(restart)
"$0" stop && "$0" start
(*)
echo "error: Unknown command $1" 1>&2
exit 1
;;
esac