Add sounds and update config files
[asterisk/asterisk.git] / redhat / asterisk
1 #!/bin/bash
2 #
3 # chkconfig: 2345 99 15
4 # description: Open source PBX 
5 # processname: asterisk
6
7 # source function library
8 . /etc/rc.d/init.d/functions
9
10 RETVAL=0
11
12 case "$1" in
13   start)
14         echo -n "Starting Asterisk PBX: "
15         /sbin/modprobe ixj      
16         daemon /usr/sbin/asterisk
17         RETVAL=$?
18         echo
19         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/asterisk
20         ;;
21   stop)
22         echo -n "Shutting Asterisk PBX: "
23         killproc asterisk
24         /sbin/rmmod -r ixj      
25         RETVAL=$?
26
27         echo
28         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/asterisk
29         ;;
30   restart|reload)
31         $0 stop
32         $0 start
33         RETVAL=$?
34         ;;
35   status)
36         status asterisk
37         RETVAL=$?
38         ;;
39   *)
40         echo "Usage: asterisk {start|stop|status|restart|reload}"
41         exit 1
42 esac
43
44 exit $RETVAL
45