#! /bin/sh # # Init-Script for SuSE Linux # # Author: Michael Diekmann # Contact: midi@undef.de # Home: http://www.undef.de # # /etc/rc.d/adsl # # Version: 1.0 # . /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). # $ADSL_DEVICE PPPD="/usr/sbin/pppd file /etc/ppp/options.dsl" MODPROBE="/sbin/modprobe" RMMOD="/sbin/rmmod" return=$rc_done case "$1" in start) echo -n "Starting ADSL" # Load modules for pppoe $MODPROBE ppp_generic $MODPROBE pppoe $MODPROBE ppp_async startproc $PPPD $ADSL_DEVICE > /dev/null 2>&1 || return=$rc_failed echo -e "$return" ;; stop) echo -n "Shutting down ADSL" killproc -TERM $PPPD > /dev/null 2>&1 || return=$rc_failed # Unload modules for pppoe $RMMOD ppp_async $RMMOD pppoe $RMMOD ppp_generic echo -e "$return" ;; restart) $0 stop && $0 start || return=$rc_failed ;; reload) echo -n "Reload service ADSL" killproc -HUP $PPPD > /dev/null 2>&1 || 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