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 # Resolve back to the basename (i.e. zaptel, not S90zaptel)
21 if [ 0`readlink $0` = "0" ]; then
22 CONFIGFILE=/etc/sysconfig/`basename $0`
25 CONFIGFILE=/etc/sysconfig/`basename $CONFIG0`
28 [ -f $CONFIGFILE ] && . $CONFIGFILE
33 # It has to be in the module list, otherwise something is wrong
34 if lsmod | grep -c ^$1 >/dev/null; then
44 rmmod $1 >/dev/null 2>&1
45 # If it's still in the module list after removing it, there's something wrong.
46 if lsmod | grep -c ^$1 >/dev/null; then
54 function reverse_modules() {
58 MODULES="$i $MODULES" ;
62 # See how we were called.
65 gprintf "Loading Asterisk modules:\n"
73 gprintf "Unloading Asterisk modules:\n"
83 gprintf "Checking Asterisk modules"
85 if [ `lsmod | grep -c $i` -eq 0 ]; then
89 if [ $OK -gt 0 ]; then
101 gprintf "*** Usage: $0 {start|stop|status|restart}\n"