build system: Builds OK under dpkg-buildpackage.
[secnet] / debian / init
CommitLineData
9d3a4132
SE
1#! /bin/sh
2# /etc/init.d/secnet
3#
4# skeleton example file to build /etc/init.d/ scripts.
5# This file should be used to construct scripts for /etc/init.d.
6#
7# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
8# Modified for Debian GNU/Linux
9# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
10#
11# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
12#
13
14set -e
15
16PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
8dea8d37 17DAEMON=/usr/sbin/secnet
9d3a4132 18NAME=secnet
8dea8d37 19DESC="VPN server"
9d3a4132
SE
20
21test -f $DAEMON || exit 0
22test -f /etc/secnet/secnet.conf || exit 0
ca58ee48 23test -f /etc/default/secnet && . /etc/default/secnet
9d3a4132 24
ca58ee48 25[ "X$RUN_SECNET" = "Xyes" ] || exit 0
9d3a4132
SE
26
27case "$1" in
28 start)
29 echo -n "Starting $DESC: "
30 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
31 --exec $DAEMON
32 echo "$NAME."
33 ;;
34 stop)
35 echo -n "Stopping $DESC: "
4f5e39ec
SE
36 start-stop-daemon --stop --quiet --oknodo --pidfile \
37 /var/run/$NAME.pid --exec $DAEMON
9d3a4132
SE
38 echo "$NAME."
39 ;;
40 #reload)
41 #
42 # If the daemon can reload its config files on the fly
43 # for example by sending it SIGHUP, do it here.
44 #
45 # If the daemon responds to changes in its config file
46 # directly anyway, make this a do-nothing entry.
47 #
48 # echo "Reloading $DESC configuration files."
49 # start-stop-daemon --stop --signal 1 --quiet --pidfile \
50 # /var/run/$NAME.pid --exec $DAEMON
51 #;;
52 restart|force-reload)
53 #
54 # If the "reload" option is implemented, move the "force-reload"
55 # option to the "reload" entry above. If not, "force-reload" is
56 # just the same as "restart".
57 #
58 echo -n "Restarting $DESC: "
59 start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
60 --exec $DAEMON
61 sleep 1
62 start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
63 --exec $DAEMON
64 echo "$NAME."
65 ;;
66 *)
67 N=/etc/init.d/$NAME
68 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
69 echo "Usage: $N {start|stop|restart|force-reload}" >&2
70 exit 1
71 ;;
72esac
73
74exit 0