Improve mandrake init files (bug #3699)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2005-03-12 06:50:22 +00:00
parent 62efe4f3b0
commit 4397ade80e
2 changed files with 45 additions and 56 deletions

View File

@@ -12,15 +12,16 @@
# Source function library.
. /etc/rc.d/init.d/functions
######################################
# CONFIGURE ME !!!
# Default modules - override in /etc/sysconfig/zaptel
######################################
MODULES="usb-uhci zaptel wcfxo wcusb"
######################################
[ -f /etc/sysconfig/`basename $0` ] && . /etc/sysconfig/`basename $0`
function probe() {
gprintf " $1"
insmod $1
modprobe -i $1
# It has to be in the module list, otherwise something is wrong
if lsmod | grep -c ^$1 >/dev/null; then
success
@@ -69,7 +70,20 @@ case "$1" in
done
;;
status)
ztcfg -vv
#ztcfg -vv
OK=1
gprintf "Checking Asterisk modules"
for i in $MODULES; do
if [ `lsmod | grep -c $i` -eq 0 ]; then
OK=0
fi
done
if [ $OK -gt 0 ]; then
success
else
failure
fi
echo
;;
restart)
$0 stop