#!/bin/sh # # apinger Start/stop the Alarm Pinger daemon. # # chkconfig: 2345 80 20 # # description: apinger is a simple ICMP-echo based network monitor # # processname: apinger # config: /etc/apinger.conf # Source function library . /etc/rc.d/init.d/functions # Get service config [ -f /etc/sysconfig/apinger ] && . /etc/sysconfig/apinger # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/apinger ]; then msg_starting Alarm Pinger daemon apinger RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/apinger else msg_Already_Running Alarm Pinger exit 1 fi ;; stop) # Stop daemons. if [ -f /var/lock/subsys/apinger ]; then msg_stopping Alarm Pinger killproc apinger rm -f /var/lock/subsys/apinger >/dev/null 2>&1 else msg_Not_Running Alarm Pinger exit 1 fi ;; status) status apinger ;; reload) killproc apinger -HUP ;; restart) $0 stop $0 start ;; *) msg_Usage: "$0 {start|stop|status|restart}" exit 1 esac exit $RETVAL