#!/bin/bash # # Script Name : stusb # # chkconfig: 345 1 99 # description: this will start and stop the Alcatel SpeedTouch USB ADSL adapter # this script is based on the two scripts provided by Johan Dijoux # # pcfe@pcfe.de # Mon Sep 3 2001 # RETVAL=0 prog="stusb" if [ ! -e /usr/lib/speedtouch/mgmt.o ] then echo 'You need the microcode from the Alcatel driver'; echo 'RTFM and then'; echo 'place it under /usr/lib/speedtouch/mgmt.o'; exit 1; fi # Includes function def if [ -f /etc/debian_version ] ; then RHSTYLE=0 else RHSTYLE=1 fi if [ $RHSTYLE -ne 0 ] ; then . /etc/init.d/functions # Check existence of the network file [ ! -f /etc/sysconfig/network ] && exit 1 # Include network defs . /etc/sysconfig/network else NETWORKING="yes" fi [ ${NETWORKING} = "no" ] && exit 1 case "$1" in start) echo -n Starting ADSL connection: route del default modprobe n_hdlc > /tmp/pppd.log & modprobe ppp_synctty > /tmp/pppd.log & modem_run -f /usr/lib/speedtouch/mgmt.o -m pppd call adsl > /tmp/pppd.log & echo " done." ;; stop) echo -n Shutting down ADSL connection: route del default kill -INT `pidof pppd` kill -INT `pidof modem_run` killall -9 modem_run echo " done." ;; restart) echo -n Restarting ADSL connection: $0 stop >/dev/null $0 start >/dev/null echo " done." ;; *) echo $"Usage: $0 {start|stop}" RETVAL=1 esac exit $RETVAL