#!/bin/sh # # l2tpd This shell script takes care of starting and stopping l2tpd. # # chkconfig: 2345 80 30 # description: Layer 2 Tunnelling Protocol Daemon (RFC 2661) # # processname: l2tpd # config: /etc/l2tpd/l2tpd.conf # pidfile: /var/run/l2tpd.pid #Servicename SERVICE=l2tpd # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network if [ ${NETWORKING} = "no" ] then exit 0 fi [ -x /usr/sbin/$SERVICE ] || exit 0 RETVAL=0 start() { echo -n "Starting $SERVICE: " daemon $SERVICE RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SERVICE echo "" return $RETVAL } stop() { echo -n "Stopping $SERVICE: " killproc $SERVICE RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$SERVICE return $RETVAL } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status $SERVICE RETVAL=$? ;; restart|reload) restart ;; try-restart) [ -f /var/lock/subsys/$SERVICE ] && restart || : ;; *) echo "Usage: $SERVICE {start|stop|status|restart|reload|try-restart}" exit 1 esac