#! /bin/sh # # Init-Script for SuSE Linux # # Author: Michael Schlenstedt # Contact: Michael@adsl4linux.de # Home: http://www.adsl4linux.de # # /etc/rc.d/adsl # # Version: 0.2b # . /etc/rc.config # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START_ADSL=yes test "$START_ADSL" = yes || exit 0 # The echo return value for success (defined in /etc/rc.config). # Path to pppd, maybe with extra options, e.g. "call CONFIGFILE" PPPD="/usr/sbin/pppd" return=$rc_done case "$1" in start) echo -n "Starting ADSL" startproc $PPPD $ADSL_DEVICE > /dev/null 2>&1 || return=$rc_failed echo -e "$return" ;; stop) echo -n "Shutting down ADSL" killproc -TERM $PPPD || return=$rc_failed echo -e "$return" ;; restart) $0 stop && $0 start || return=$rc_failed ;; reload) echo -n "Reload service ADSL" killproc -HUP $PPPD || return=$rc_failed echo -e "$return" ;; status) echo -n "Checking for service ADSL: " checkproc $PPPD && echo OK || echo No process ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 1 esac test "$return" = "$rc_done" || exit 1 exit 0