#!/bin/bash # # syslog Starts syslogd/klogd. # # # chkconfig: 2345 97 88 # description: Syslog is the facility by which many daemons use to log \ # messages to various system log files. It is a good idea to always \ # run syslog. ### BEGIN INIT INFO # Provides: $syslog ### END INIT INFO # Source function library. . /etc/init.d/functions RETVAL=0 umask 077 start() { #echo -n $"Starting Asterisk modules: " #modprobe zaptel #modprobe wctdm #modprobe wct1xxp #ztcfg -v #success $"asterisk modules startup" #echo echo -n $"Starting Asterisk: " daemon /usr/sbin/safe_asterisk RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/asterisk return $RETVAL } stop() { echo -n $"Shutting down Asterisk: " killproc safe_asterisk killproc asterisk success $"asterisk modules stop" #echo #echo -n $"Removing modules: " #rmmod wctdm #rmmod zaptel echo RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/asterisk return $RETVAL } rhstatus() { status safe_asterisk } restart() { stop start } case "$1" in start) start ;; stop) stop ;; status) rhstatus ;; restart|reload) restart ;; condrestart) [ -f /var/lock/subsys/asterisk ] && restart || : ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart}" exit 1 esac exit $?