]> git.ipfire.org Git - ipfire-2.x.git/blob - src/rc.d/rc.conexantusbadsl
Ein NTFS-Update fuer den Heiner :D
[ipfire-2.x.git] / src / rc.d / rc.conexantusbadsl
1 #!/bin/bash
2 #
3 # $Id: rc.conexantusbadsl,v 1.5.2.4 2005/07/07 20:11:58 franck78 Exp $
4 #
5
6 eval $(/usr/local/bin/readhash CONFIG_ROOT/ppp/settings)
7
8 # Debugging. Comment it out to stop logging
9 DEBUG="yes"
10 msg() {
11 if [ "z$DEBUG" != "z" ] ; then
12 /usr/bin/logger -t red "Conexant USB: $*"
13 fi
14 /bin/echo "$*"
15 }
16
17 # See how we were called.
18 case "$1" in
19 start)
20 if [ -f "/proc/bus/usb/devices" ]; then
21 if ( ! /bin/cat /proc/bus/usb/devices | /bin/grep -q xdslusb ); then
22 echo "cxload"
23 /usr/sbin/cxload
24 if [ $? -ne 0 ]; then
25 msg "cxload failed"
26 exit 1
27 fi
28 fi
29 eval $(/usr/local/bin/readhash /tmp/cxacru.params)
30 /sbin/modprobe cxacru open=$PARAM_0a
31 if [ $? -ne 0 ]; then
32 msg "cxacru loading failed"
33 exit 2
34 fi
35 /bin/sleep 12
36 /usr/sbin/cxioctl 1
37 if [ $? -ne 0 ]; then
38 msg "cxioctl failed"
39 exit 3
40 fi
41 /bin/sleep 3
42 fi
43 ;;
44 stop)
45 msg "stop"
46 /usr/sbin/cxioctl 2
47 ;;
48 cleanup)
49 msg "driver cleanup and USB Bus reset"
50 /usr/sbin/cxioctl 5
51 /sbin/modprobe -r cxacru
52 /bin/sleep 4
53 /usr/local/bin/resetusb
54 ;;
55 *)
56 /bin/echo "Usage: $0 {start|stop|cleanup}"
57 exit 1
58 ;;
59 esac
60
61 exit 0