- smsd.init
#! /bin/bash
#
# smsd Start/Stop the SMS Dispatcher Server
#
# chkconfig: 2345 98 02
# description: Dispatch SMS message for Nagios
# processname: smsd.pl
# pidfile: /var/run/smsd.pid
# Source function library.
. /etc/init.d/functions
RETVAL=0
# See how we were called.
prog="smsd.pl"
progdir="/usr/sbin"
# Source configuration
if [ -f /etc/sysconfig/$prog ] ; then
. /etc/sysconfig/$prog
fi
start() {
echo -n $"Starting $prog: "
daemon $progdir/$prog -d
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/smsd.pl
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
# Would be better to send QUIT first, then killproc if that fails
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/smsd.pl
return $RETVAL
}
rhstatus() {
status smsd.pl
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
rhstatus
;;
condrestart)
[ -f /var/lock/subsys/smsd.pl ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
exit 1
esac
exit $?
Back to top