Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / xl2tpd / debian / xl2tpd.init
blobb910a905b7fe3745d0528bc56c9c1eef8c8fbeac
1 #! /bin/sh
3 ### BEGIN INIT INFO
4 # Provides: xl2tpd l2tpd
5 # Required-Start: $network $syslog $remote_fs
6 # Required-Stop: $network $syslog $remote_fs
7 # Should-Start: ipsec
8 # Should-Stop: ipsec
9 # Default-Start: 2 3 4 5
10 # Default-Stop: 0 1 6
11 # Short-Description: layer 2 tunelling protocol daemon
12 # Description: xl2tpd is usually used in conjunction with an ipsec
13 # daemon (such as openswan).
14 ### END INIT INFO
16 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
17 DAEMON=/usr/sbin/xl2tpd
18 NAME=xl2tpd
19 DESC=xl2tpd
21 test -x $DAEMON || exit 0
23 # Include xl2tpd defaults if available
24 if [ -f /etc/default/xl2tpd ] ; then
25 . /etc/default/xl2tpd
28 PIDFILE=/var/run/$NAME.pid
30 set -e
32 case "$1" in
33 start)
34 echo -n "Starting $DESC: "
35 test -d ${XL2TPD_RUN_DIR:-/var/run/xl2tpd} || mkdir -p ${XL2TPD_RUN_DIR:-/var/run/xl2tpd}
36 start-stop-daemon --start --quiet --pidfile $PIDFILE \
37 --exec $DAEMON -- $DAEMON_OPTS
38 echo "$NAME."
40 stop)
41 echo -n "Stopping $DESC: "
42 start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
43 --exec $DAEMON
44 echo "$NAME."
46 force-reload)
47 test -d ${XL2TPD_RUN_DIR:-/var/run/xl2tpd} || mkdir -p ${XL2TPD_RUN_DIR:-/var/run/xl2tpd}
48 # check whether $DAEMON is running. If so, restart
49 start-stop-daemon --stop --test --quiet --pidfile \
50 $PIDFILE --exec $DAEMON \
51 && $0 restart \
52 || exit 0
54 restart)
55 test -d ${XL2TPD_RUN_DIR:-/var/run/xl2tpd} || mkdir -p ${XL2TPD_RUN_DIR:-/var/run/xl2tpd}
56 echo -n "Restarting $DESC: "
57 start-stop-daemon --stop --quiet --pidfile \
58 $PIDFILE --exec $DAEMON
59 sleep 1
60 start-stop-daemon --start --quiet --pidfile \
61 $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
62 echo "$NAME."
65 N=/etc/init.d/$NAME
66 echo "Usage: $N {start|stop|restart|force-reload}" >&2
67 exit 1
69 esac
71 exit 0