#!/bin/bash # # chkconfig: 345 09 91 # description: This is the boot/shutdown script for the Conexant AccessRunner # ADSL modem. # Source function library. . /etc/init.d/functions BRCTL=/usr/local/bin/br2684ctl CNXADSLCONF=/etc/Conexant/cnxadsl.conf # See how we were called. case "$1" in start) # if the driver is not already loaded then # Load the module if [ ! -f /var/lock/subsys/cnxadsl ]; then echo "Starting Conexant AccessRunner..." modprobe CnxADSL \ CnxtDslVendorId=0x14F1 \ CnxtDslArmDeviceId=0x1610 \ CnxtDslAdslDeviceId=0x1611 \ CnxtDslPhysicalDriverType=1 # Initialize the firmware and start training echo -n "Loading firmware" /etc/Conexant/cnxadslload >/dev/null /etc/Conexant if [ $? ]; then success else failure exit 1 fi echo if ! grep -q br2684_init /proc/ksyms; then echo -n "Loading br2684 module: " modprobe br2684 fi RETVAL=$? if [ $RETVAL -eq 0 ] ; then success echo touch /var/lock/subsys/cnxadsl # Create the tty device devmajor=`awk '/ttyCX/ { print $1 }' /proc/devices` devmajor=${devmajor:?"Could not find device"} rm -f /dev/ttyCX mknod --mode=660 /dev/ttyCX c $devmajor 0 tmpsh=`mktemp /tmp/Cnx${devmajor}.XXXXXX` gawk '/ATM_V[CP]I/ {print $1"="$2}' \ $CNXADSLCONF >>$tmpsh . $tmpsh rm -f $tmpsh $BRCTL -b -c0 -a ${ATM_VPI}.${ATM_VCI} fi else echo "AccessRunner already loaded" fi ;; stop) killproc $BRCTL if [ -f /var/lock/subsys/cnxadsl ]; then echo -n "Stopping Conexant AccessRunner:" # unload the module rmmod CnxADSL rmmod br2684 # get rid of the tty device rm -f /dev/ttyCX rm -f /var/lock/subsys/cnxadsl echo fi ;; status) if [ -f /var/lock/subsys/cnxadsl ]; then cat /proc/net/atm/CnxAdsl:0 else status cnxadsl fi ;; *) echo $"Usage: $0 {start|stop|status|probe}" exit 1 esac exit 0