#!/bin/bash # # description: This is the boot/shutdown script for the Conexant AccessRunner # ADSL modem. CNXADSLCONFIG=/usr/bin/cnxadslconfig CNXADSLLOAD=/etc/Conexant/cnxadslload CONFIG_DIR=/etc/Conexant LOCK_FILE=/var/lock/cnxadslctl VPI=0 VCI=100 NAME=cnxadsl DESC="Conexant AccessRunner ADSL Modem" # See how we were called. case "$1" in start) # if the driver is not already loaded then load the module if [ ! -f $LOCK_FILE ]; then echo -n "Starting $DESC: $NAME" insmod -sq CnxADSL \ CnxtDslVendorId=0x14F1 \ CnxtDslArmDeviceId=0x1610 \ CnxtDslAdslDeviceId=0x1611 \ CnxtDslPhysicalDriverType=1 &> /dev/null if [ "$?" != "0" ]; then echo " FAILED - Could not load module!" exit 1 fi # Initialize the firmware and start training $CNXADSLLOAD $CONFIG_DIR # Set the lockfile touch $LOCK_FILE # Configure the VPI / VCI $CNXADSLCONFIG --vpi=$VPI --vci=$VCI else echo -n "$DESC already loaded" fi echo "." ;; stop) if [ -f $LOCK_FILE ]; then echo -n "Stopping $DESC: $NAME " #unload the module rmmod CnxADSL # Remove the lock file rm -f $LOCK_FILE echo "." fi ;; restart) $0 stop sleep 2 $0 start ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 esac exit 0