#!/bin/bash # # fonulator Starts and Stops the Redfone fonulator utility # This script will fonulate two foneBridge devices # # chkconfig: 2345 60 50 # description: Utility for configuring the Redfone fonebridge # # processname: fonulator # config: /etc/redfone.conf # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -x /usr/local/bin/fonulator ] || exit 0 RETVAL=0 prog="fonulator" start() { # Start daemons. if [ -d /etc/ ] ; then for i in `ls /etc/redfone.conf`; do site=`basename $i .conf` echo -n $"Starting $prog for $site: " /usr/local/bin/fonulator -s /etc/redfone.conf & RETVAL=$? [ $RETVAL -eq 0 ] && { touch /var/lock/subsys/$prog success $"$prog $site" } /usr/local/bin/fonulator -s /etc/redfone2.conf & echo done else RETVAL=1 fi return $RETVAL } stop() { # Stop daemons. echo -n $"Shutting down $prog: " killproc $prog RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart|reload) stop start RETVAL=$? ;; condrestart) if [ -f /var/lock/subsys/$prog ]; then stop start RETVAL=$? fi ;; status) status $prog RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" exit 1 esac exit $RETVAL