#!/bin/bash # # adsl Script to control adsl line, using eciadsl and rp-pppoe # # chkconfig: 35 84 17 # description: eciadsl drivers for D-Link modem, and Roaring Penguin # PPPoE client # *** JD *** # Modified to include bringing up ppp0 via rp-pppoe # BEGIN OF CONFIG_SECTION EXEC_PREFIX="/usr/local/bin" # *** JD *** PPP_START=/sbin/adsl-start # END OF CONFIG_SECTION #set -xv # Source function library. . /etc/rc.d/init.d/functions case "$1" in start) echo -n "Starting adsl: " # *** JD *** PATH=$EXEC_PREFIX:/usr/bin:/usr/sbin:/bin:/sbin eciadsl-start > /dev/null 2>&1 # eciadsl-start exits with result code 6 - means we need to run pppoe result=$? if [ $result -eq 6 ]; then $PPP_START fi echo exit $? ;; stop) echo -n "Shutting down adsl: " PATH=$EXEC_PREFIX:/usr/bin:/usr/sbin:/bin:/sbin eciadsl-stop echo exit $? ;; status) echo -n "Checking for adsl: " /bin/ps ax | /bin/grep $EXEC_PREFIX/eciadsl-pppoeci | /bin/grep -v grep && echo "OK" || echo "No process" echo ;; restart) $0 stop && $0 start exit $? ;; *) echo "Usage: adsl {start|stop|status|restart}" exit 1 ;; esac exit 0