#!/bin/sh # # adsl This script starts or stops an ADSL connection # # chkconfig: - 345 80 20 # description: Connects to ADSL provider # # Based upon original script which comes with rp-pppoe # Modified by Michael Schlenstedt, Michael@adsl4linux.de # # Tested with Red Hat Linux 7.1 and pppoe with 2.4.4 # # /etc/rc.d/init.d/adsl # # Version 0.3a # Path to pppd and maybe some exra Options, e.g. "call CONFIGFILE" PPPD="/usr/sbin/pppd" # Ethernetdevice connected with your ADSL-Modem ADSL_DEVICE=eth1 # Source function library if it exists test -r /etc/rc.d/init.d/functions && . /etc/rc.d/init.d/functions [ -x $PPPD ] || exit 0 RETVAL=0 start() { if [ ! -f /var/lock/subsys/pppoe ]; then echo -n "Bringing up ADSL link" $PPPD $ADSL_DEVICE > /dev/null 2>&1 RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pppoe echo fi return $RETVAL } stop() { echo -n "Shutting down ADSL link" killall $PPPD RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/pppoe echo return $RETVAL } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; condrestart) [ -f /var/lock/subsys/pppoe ] && restart || : ;; *) echo "Usage: pppoe {start|stop|restart|condrestart}" exit 1 esac exit $RETVAL