]> git.pld-linux.org Git - packages/dahdi-tools.git/blame - dahdi.init
- added
[packages/dahdi-tools.git] / dahdi.init
CommitLineData
d11d4b7c 1#!/bin/sh
2#
3# dahdi dahdi modules
4#
5# chkconfig: 345 85 15
6# description: DAHDI is a series of telephony interface devices often \
7# used with Asterisk
8#
9
10# Source function library
11. /etc/rc.d/init.d/functions
12
13# Get service config
14[ -f /etc/sysconfig/dahdi ] && . /etc/sysconfig/dahdi
15
16start() {
17 # Check if the service is already running?
18 if [ ! -f /var/lock/subsys/dahdi ]; then
19 msg_starting dahdi
20 busy
21 for mod in $ZAP_MODULES; do
22 modprobe $mod
23 done
24 sleep 2
25 /sbin/ztcfg
26 RETVAL=$?
27 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dahdi
28 ok
29 else
30 msg_already_running dahdi
31 fi
32}
33
34stop() {
35 # Stop daemons.
36 if [ -f /var/lock/subsys/dahdi ]; then
37 msg_stopping dahdi
38 busy
39 for mod in $ZAP_MODULES; do
40 if test x$mod != xdahdi; then
41 rmmod $mod
42 fi
43 done
44 rmmod dahdi
45 rm -f /var/lock/subsys/dahdi >/dev/null 2>&1
46 ok
47 else
48 msg_not_running dahdi
49 fi
50}
51
52RETVAL=0
53# See how we were called.
54case "$1" in
55 start)
56 start
57 ;;
58 stop)
59 stop
60 ;;
61 status)
62 RETVAL=0
63 ;;
64 restart)
65 stop
66 start
67 ;;
68 reload|force-reload|graceful)
69 if [ -f /var/lock/subsys/dahdi ]; then
70 /sbin/ztcfg
71 RETVAL=$?
72 else
73 msg_not_running dahdi
74 RETVAL=7
75 fi
76 ;;
77 *)
78 msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
79 exit 3
80 ;;
81esac
82
83exit $RETVAL
This page took 0.062166 seconds and 4 git commands to generate.