]>
Commit | Line | Data |
---|---|---|
bf7c473f MT |
1 | #!/bin/bash |
2 | ######################################################################## | |
3 | # Begin $network_devices/services/isdn | |
4 | # | |
5 | # Description : ISDN Script | |
6 | # | |
7 | # Authors : Michael Tremer - mitch@ipfire.org | |
8 | # | |
9 | # Version : 01.00 | |
10 | # | |
11 | # Notes : | |
12 | # | |
13 | ######################################################################## | |
14 | ||
15 | . /etc/sysconfig/rc | |
16 | . ${rc_functions} | |
17 | eval $(/usr/local/bin/readhash /var/ipfire/ppp/settings) | |
18 | ||
19 | case "${1}" in | |
20 | up) | |
21 | boot_mesg "Bringing up the ISDN interface..." | |
22 | ||
23 | if [ "$ENABLED" = "on" ]; then | |
24 | modprobe -r hisax_st5481 2>/dev/null | |
25 | modprobe -r hisax_fcpcipnp 2>/dev/null | |
26 | modprobe -r hisax_isac 2>/dev/null | |
27 | modprobe -r hisax 2>/dev/null | |
28 | ||
29 | if [ "$TYPE" = "998" ]; then | |
30 | modprobe hisax_st5481 protocol=$PROTOCOL $MODULE_PARAMS | |
31 | (exit $?) | |
32 | evaluate_retval | |
33 | elif [ "$TYPE" = "999" ]; then | |
34 | modprobe hisax_fcpcipnp protocol=$PROTOCOL $MODULE_PARAMS | |
35 | (exit $?) | |
36 | evaluate_retval | |
37 | else | |
38 | modprobe hisax protocol=$PROTOCOL type=$TYPE $MODULE_PARAMS | |
39 | (exit $?) | |
40 | evaluate_retval | |
41 | fi | |
42 | ||
43 | else | |
44 | logger -t red "ISDN: "No ISDN enabled" | |
45 | (exit 1) | |
46 | evaluate_retval | |
47 | fi | |
48 | ;; | |
49 | ||
50 | down) | |
51 | boot_mesg "Bringing down the ISDN interface..." | |
52 | isdnctrl delif ippp1 2>/dev/null || failed=1 | |
53 | isdnctrl delif ippp0 2>/dev/null || failed=1 | |
54 | killproc ipppd 2>/dev/null || failed=1 | |
55 | killproc ibod 2>/dev/null || failed=1 | |
56 | modprobe -r hisax_st5481 2>/dev/null || failed=1 | |
57 | modprobe -r hisax_fcpcipnp 2>/dev/null || failed=1 | |
58 | modprobe -r hisax_isac 2>/dev/null || failed=1 | |
59 | modprobe -r hisax 2>/dev/null || failed=1 | |
60 | (exit ${failed}) | |
61 | evaluate_retval | |
62 | ;; | |
63 | ||
64 | *) | |
65 | echo "Usage: ${0} {up|down}" | |
66 | exit 1 | |
67 | ;; | |
68 | esac | |
69 | ||
70 | # End $network_devices/services/isdn |