chiark / gitweb /
changelog: start 0.6.8
[secnet.git] / debian / init
index c22b55f4c59392bdaf985a337c537cb55a2741db..dc3ee70f0af5c4013079491ab7123aceeeefaa40 100644 (file)
@@ -1,15 +1,20 @@
 #! /bin/sh
 # /etc/init.d/secnet
 #
-# skeleton     example file to build /etc/init.d/ scripts.
-#              This file should be used to construct scripts for /etc/init.d.
-#
-#              Written by Miquel van Smoorenburg <miquels@cistron.nl>.
-#              Modified for Debian GNU/Linux
-#              by Ian Murdock <imurdock@gnu.ai.mit.edu>.
-#
-# Version:     @(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
-#
+# This file is part of secnet.
+# See LICENCE and CREDITS for full list of copyright holders.
+# SPDX-License-Identifier: GPL-3.0-or-later
+# There is NO WARRANTY.
+
+### BEGIN INIT INFO
+# Provides:          secnet
+# Required-Start:    $network $local_fs $remote_fs
+# Required-Stop:     $network $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start and stop secnet
+# Description:       secnet is a VPN server.
+### END INIT INFO
 
 set -e
 
@@ -19,9 +24,13 @@ NAME=secnet
 DESC="VPN server"
 
 test -f $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
 test -f /etc/secnet/secnet.conf || exit 0
+test -f /etc/default/secnet && . /etc/default/secnet
 
-set -e
+[ "X$RUN_SECNET" = "Xyes" ] || exit 0
 
 case "$1" in
   start)
@@ -32,8 +41,8 @@ case "$1" in
        ;;
   stop)
        echo -n "Stopping $DESC: "
-       start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
-               --exec $DAEMON
+       start-stop-daemon --stop --quiet --oknodo --pidfile \
+           /var/run/$NAME.pid --exec $DAEMON
        echo "$NAME."
        ;;
   #reload)
@@ -56,7 +65,7 @@ case "$1" in
        #
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
-               --exec $DAEMON
+               --oknodo --exec $DAEMON
        sleep 1
        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
                --exec $DAEMON