Allow IPv6 address entry in tools>ping - Loosens valid character check
[tomato/davidwu.git] / release / src / router / xl2tpd / packaging / fedora / xl2tpd.init
blobe0494e31f69f67a19713f169fad0eb1c205a9953
1 #!/bin/sh
3 # xl2tpd This shell script takes care of starting and stopping l2tpd.
5 # chkconfig: - 80 30
6 # description: Layer 2 Tunnelling Protocol Daemon (RFC 2661)
8 # processname: /usr/sbin/xl2tpd
9 # config: /etc/xl2tpd/xl2tpd.conf
10 # pidfile: /var/run/xl2tpd.pid
12 ### BEGIN INIT INFO
13 # Provides: xl2tpd
14 # Required-Start: $local_fs $network $syslog
15 # Required-Stop: $local_fs $network $syslog
16 # Default-Start:
17 # Default-Stop: 0 1 2 3 4 5 6
18 # Short-Description: start|stop|status|restart|try-restart|reload|force-reload xl2tpd server
19 # Description: control xl2tpd server
20 ### END INIT INFO
22 #Servicename
23 SERVICE=xl2tpd
25 # Source function library.
26 . /etc/rc.d/init.d/functions
28 # Source networking configuration.
29 . /etc/sysconfig/network
31 if [ ${NETWORKING} = "no" ]
32 then
33 exit 0
36 [ -x /usr/sbin/$SERVICE ] || exit 0
38 RETVAL=0
40 start() {
41 echo -n "Starting $SERVICE: "
42 if [ ! -d /var/run/xl2tpd ]
43 then
44 mkdir /var/run/xl2tpd
46 daemon $SERVICE
47 RETVAL=$?
48 echo
49 if [ $RETVAL -eq 0 ];then
50 touch /var/lock/subsys/$SERVICE
51 else
52 exit 7;
54 return 0;
57 stop() {
58 echo -n "Stopping $SERVICE: "
59 killproc $SERVICE
60 RETVAL=$?
61 if [ $RETVAL -eq 0 ]; then
62 rm -f /var/run/xl2tpd/$SERVICE
63 rm -f /var/lock/subsys/$SERVICE
65 echo
66 return $RETVAL
69 restart() {
70 stop
71 start
74 # See how we were called.
75 case "$1" in
76 start)
77 start
79 stop)
80 stop
82 status)
83 status $SERVICE
84 RETVAL=$?
86 restart|reload)
87 restart
89 condrestart)
90 [ -f /var/lock/subsys/$SERVICE ] && restart || :
93 echo "Usage: $SERVICE {start|stop|status|restart|reload|condrestart}"
94 exit 1
95 esac