mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-06-28 11:55:08 +03:00
Create a softether.upstart file in the Debian overlay for systems that use the upstart init subsystem. This lets the operator control the SoftEther daemon with commands like: # start softether # stop softether # status softether # restart softether Also modify the softether.init file to exit early if the /etc/init/softether file is installed. Although the dh_installinit debhelper prefers an upstart configuration for automatic control, it will also install the sysv script.
50 lines
937 B
Bash
Executable File
50 lines
937 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
|
|
|
|
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
|
|
(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
|