diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2002-06-06 23:29:20 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2002-06-06 23:29:20 +0000 |
commit | c63dd8597671fa41afb9fe9a1909ace27c6c447c (patch) | |
tree | 3650a2ed1a30276a6f17987c04e43a41bfc5d9a1 /zaptel.init | |
parent | ca05ac8675b59ff321e6b8dc12fa4652a003ede6 (diff) |
Version 0.2.0 from FTP
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@84 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.init')
-rwxr-xr-x | zaptel.init | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/zaptel.init b/zaptel.init new file mode 100755 index 0000000..18c199c --- /dev/null +++ b/zaptel.init @@ -0,0 +1,84 @@ +#!/bin/sh +# +# zaptel This shell script takes care of loading and unloading \ +# Zapata Telephony interfaces +# chkconfig: 2345 9 92 +# description: The zapata telephony drivers allow you to use your linux \ +# computer to accept incoming data and voice interfaces +# +# config: /etc/sysconfig/zaptel + +# Source function library. +. /etc/rc.d/init.d/functions + +[ -f /etc/sysconfig/zaptel ] || exit 0 + +# Source zaptel configuration. +. /etc/sysconfig/zaptel + +# Check that telephony is up. +if [ "${TELEPHONY}" = "no" ]; then + exit 0 +fi + +[ -f /sbin/ztcfg ] || exit 0 + +[ -f /etc/zaptel.conf ] || exit 0 + +RETVAL=0 + +MODULES="torisa tor2 wct1xxp wcfxs wcfxo wcfxsusb" + +RMODULES="wcfxsusb wcfxo wcfxs wct1xxp tor2 torisa" + +if [ "${DEBUG}" = "yes" ]; then + ARGS="debug=1" +fi + +# See how we were called. +case "$1" in + start) + # Load drivers + action "Loading zaptel framework: " modprobe zaptel + echo -n "Loading zaptel hardware modules: " + for x in $MODULES; do + if insmod ${x} ${ARGS} >& /dev/null; then + echo -n "$x " + fi + done + echo + action "Running ztcfg: " /sbin/ztcfg + RETVAL=$? + + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zaptel + + ;; + stop) + # Stop daemons. + echo -n "Unloading zaptel hardware drivers: " + for x in $RMODULES; do + if rmmod ${x} >& /dev/null; then + echo -n "$x " + fi + done + echo + + action "Removing zaptel module: " rmmod zaptel + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zaptel + ;; + restart) + $0 stop + $0 start + RETVAL=$? + ;; + reload) + action "Reloading ztcfg: " /sbin/ztcfg + ;; + *) + echo "Usage: zaptel {start|stop|restart|reload}" + exit 1 +esac + +exit $RETVAL + |