diff options
Diffstat (limited to 'projectroot/etc/init.d/pppd')
-rw-r--r-- | projectroot/etc/init.d/pppd | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/projectroot/etc/init.d/pppd b/projectroot/etc/init.d/pppd new file mode 100644 index 000000000..93cc92401 --- /dev/null +++ b/projectroot/etc/init.d/pppd @@ -0,0 +1,60 @@ +#!/bin/sh +# +DAEMON=/usr/sbin/pppd +PIDFILE=/var/run/ppp0.pid + +# define the interface used for the connection +DAEMON_OPTS=@PPPD_INTF@ + +case "${1}" in + start) + if [ -e $PIDFILE ]; then + echo "pppd already running" + exit 1 + fi + echo "Starting pppd..." + $DAEMON $DAEMON_OPTS || echo "failed" + ;; + + stop) + if [ ! -e $PIDFILE ]; then + echo "pppd not running" + exit 1 + fi + echo "Stopping pppd..." + kill -s SIGTERM `cat $PIDFILE` || echo "failed" + ;; + + restart) + if [ ! -e $PIDFILE ]; then + echo "pppd not running" + exit 1 + fi + echo "Restarting pppd..." + kill -s SIGTERM `cat $PIDFILE` || echo "failed" + sleep 1 + $DAEMON $DAEMON_OPTS || echo "failed" + ;; + + status) + if [ -e $PIDFILE ]; then + echo "pppd running" + else + echo "pppd not running" + fi + ;; + + hangup) + if [ ! -e $PIDFILE ]; then + echo "pppd not running" + exit 1 + fi + echo "pppd hanging up" + kill -s SIGHUP `cat $PIDFILE` || echo "failed" + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status|hangup}" + exit 1 + ;; +esac |