3
# $Id: rc.alcatelusb,v 1.7.2.12 2005/07/07 20:11:57 franck78 Exp $
6
eval $(/usr/local/bin/readhash /var/ipcop/ppp/settings)
8
# Debugging. Comment it out to stop logging
11
if [ "z$DEBUG" != "z" ] ; then
12
/usr/bin/logger -t red "Speedtouch USB: $*"
17
function wait_for_iface()
19
msg "Waiting for interface: $1"
23
while [ $TIMES -le $COUNTER ]; do
24
/sbin/ifconfig $1> /dev/null 2>&1
30
TIMES=$(expr $TIMES + 1)
32
if [ "$FLREADY" -eq 0 ]; then
33
msg "Interface not found: $1"
38
# See how we were called.
41
if [ ! -f "/proc/bus/usb/devices" ]; then
45
speedtouch=`/bin/cat /proc/bus/usb/devices | /bin/grep 'Vendor=06b9 ProdID=4061' | /usr/bin/cut -d ' ' -f6`
48
msg "No Speedtouch found"
51
'0.00' | '0.01' | '2.00')
53
# Speedtouch 530 aka Rev 3.00 does not work actually
59
msg "Unknown version or unsupported model Rev $speedtouch"
63
if ( ! /bin/ps -ef | /bin/grep -q [m]odem_run ); then
64
rm -f /var/run/pppoa3-modem*.pid
65
msg "Uploading firmware to modem"
66
/usr/sbin/modem_run -v 1 -t 90 -n 4 -f /var/ipcop/alcatelusb/firmware.$modem.bin
68
# Check if Firmware uploaded ok. Reset USB if Failed
70
msg "Firmware upload failed: Retrying"
71
/usr/local/bin/resetusb
72
/usr/sbin/modem_run -v 1 -t 90 -n 4 -f /var/ipcop/alcatelusb/firmware.$modem.bin
74
msg "Firmware upload failed: Exiting"
80
# Alcatel USB PPPoE Mode
81
if [ "$PROTOCOL" = "RFC1483" ]; then
84
/usr/sbin/pppoa3 -b -c -m 1 -vpi $VPI -vci $VCI
86
/sbin/ifconfig $iface up
93
/bin/killall pppoa3 2>/dev/null
98
msg "driver cleanup and USB Bus reset"
99
/usr/local/bin/resetusb
102
/bin/echo "Usage: $0 {start|stop|cleanup}"