#!/bin/bash # # $Id: rc.conexantusbadsl,v 1.5.2.4 2005/07/07 20:11:58 franck78 Exp $ # eval $(/usr/local/bin/readhash CONFIG_ROOT/ppp/settings) # Debugging. Comment it out to stop logging DEBUG="yes" msg() { if [ "z$DEBUG" != "z" ] ; then /usr/bin/logger -t red "Conexant USB: $*" fi /bin/echo "$*" } # See how we were called. case "$1" in start) if [ -f "/proc/bus/usb/devices" ]; then if ( ! /bin/cat /proc/bus/usb/devices | /bin/grep -q xdslusb ); then echo "cxload" /usr/sbin/cxload if [ $? -ne 0 ]; then msg "cxload failed" exit 1 fi fi eval $(/usr/local/bin/readhash /tmp/cxacru.params) /sbin/modprobe cxacru open=$PARAM_0a if [ $? -ne 0 ]; then msg "cxacru loading failed" exit 2 fi /bin/sleep 12 /usr/sbin/cxioctl 1 if [ $? -ne 0 ]; then msg "cxioctl failed" exit 3 fi /bin/sleep 3 fi ;; stop) msg "stop" /usr/sbin/cxioctl 2 ;; cleanup) msg "driver cleanup and USB Bus reset" /usr/sbin/cxioctl 5 /sbin/modprobe -r cxacru /bin/sleep 4 /usr/local/bin/resetusb ;; *) /bin/echo "Usage: $0 {start|stop|cleanup}" exit 1 ;; esac exit 0