]>
Commit | Line | Data |
---|---|---|
cd1a2927 MT |
1 | #!/bin/bash |
2 | # | |
3 | # $Id: rc.pulsardsl,v 1.3.2.8 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 "Pulsar DSL: $*" | |
13 | fi | |
14 | echo "$*" | |
15 | } | |
16 | ||
17 | # See how we were called. | |
18 | case "$1" in | |
19 | start) | |
20 | if ( ! /sbin/lsmod | /bin/grep -q pulsar ); then | |
21 | /sbin/modprobe pulsar | |
22 | if [ $? -ne 0 ]; then | |
23 | msg "Pulsar loading failed" | |
24 | exit 2 | |
25 | else | |
26 | # arbitrary fixed time until the driver support a way to know that the modem is synchronised | |
27 | /bin/sleep 60 | |
28 | fi | |
29 | fi | |
30 | exit 0 | |
31 | ;; | |
32 | stop) | |
33 | msg "stop" | |
34 | ;; | |
35 | cleanup) | |
36 | msg "driver cleanup" | |
37 | /sbin/modprobe -r pulsar | |
38 | ;; | |
39 | *) | |
40 | echo "Usage: $0 {start|stop|cleanup}" | |
41 | exit 1 | |
42 | ;; | |
43 | esac | |
44 | ||
45 | exit 0 |