]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/rc.d/rc.alcatelusbk
3 # $Id: rc.alcatelusbk,v 1.6.2.11 2005/07/07 20:11:57 franck78 Exp $
6 eval $
(/usr
/local
/bin
/readhash CONFIG_ROOT
/ppp
/settings
)
8 # Debugging. Comment it out to stop logging
11 if [ "z$DEBUG" != "z" ] ; then
12 /usr
/bin
/logger
-t red
"Speedtouch USB K: $*"
18 # See how we were called.
21 if [ ! -f "/proc/bus/usb/devices" ]; then
25 speedtouch
=`/bin/cat /proc/bus/usb/devices | /bin/grep 'Vendor=06b9 ProdID=4061' | /usr/bin/cut -d ' ' -f6`
28 msg
"No Speedtouch found"
31 '0.00' |
'0.01' |
'2.00')
33 # Speedtouch 530 aka Rev 3.00 does not work actually
39 msg
"Unknown version or unsupported model Rev $speedtouch"
43 if ( ! /bin
/ps
-ef |
/bin
/grep -q '[m]odem_run -k'); then
44 # modem_run was killed by "hub.c: already running port x disabled by hub (EMI?), re-enabling..."
45 /sbin
/modprobe
-r speedtch
47 if ( ! /sbin
/lsmod |
/bin
/grep -q [s
]peedtch
); then
48 if ( /bin
/ps
-ef |
/bin
/grep -q [m
]odem_run
); then
49 # switching from user to kernel mode
50 msg
"need to kill previous modem_run"
51 /bin
/killall
/usr
/sbin
/modem_run
52 /usr
/local
/bin
/resetusb
54 /sbin
/modprobe speedtch
55 /usr
/sbin
/modem_run
-k -v 1 -t 90 -n 4 -f CONFIG_ROOT
/alcatelusb
/firmware.
$modem.bin
57 msg
"firmware download failed : will reset USB and try again"
58 /sbin
/modprobe
-r speedtch
59 /usr
/local
/bin
/resetusb
60 /sbin
/modprobe speedtch
61 /usr
/sbin
/modem_run
-k -v 1 -t 90 -n 4 -f CONFIG_ROOT
/alcatelusb
/firmware.
$modem.bin
66 # time to avoid "Ressource temporary unavailable"
75 msg
"driver cleanup and USB Bus reset"
76 /sbin
/modprobe
-r speedtch
77 /usr
/local
/bin
/resetusb
80 /bin
/echo "Usage: $0 {start|stop|cleanup}"