3 # zaptel: Loads Asterisk modules
5 # Version: @(#) /etc/rc.d/init.d/zaptel 1.0
7 # chkconfig: 2345 90 10
8 # description: Loads and unloads zaptel modules at boot time and shutdown.
12 # Source function library.
13 . /etc/rc.d/init.d/functions
15 # Default modules - override in /etc/sysconfig/zaptel
16 ######################################
17 MODULES="usb-uhci zaptel wcfxo wcusb"
18 ######################################
20 [ -f /etc/sysconfig/`basename $0` ] && . /etc/sysconfig/`basename $0`
25 # It has to be in the module list, otherwise something is wrong
26 if lsmod | grep -c ^$1 >/dev/null; then
36 rmmod $1 >/dev/null 2>&1
37 # If it's still in the module list after removing it, there's something wrong.
38 if lsmod | grep -c ^$1 >/dev/null; then
46 function reverse_modules() {
50 MODULES="$i $MODULES" ;
54 # See how we were called.
57 gprintf "Loading Asterisk modules:\n"
65 gprintf "Unloading Asterisk modules:\n"
75 gprintf "Checking Asterisk modules"
77 if [ `lsmod | grep -c $i` -eq 0 ]; then
81 if [ $OK -gt 0 ]; then
93 gprintf "*** Usage: $0 {start|stop|status|restart}\n"