9e33da5
#! /bin/bash
9e33da5
#
9e33da5
# smokeping    This starts and stops the smokeping daemon
9e33da5
# chkconfig: - 98 11
9e33da5
# description: Start and top the smokeping daemon
9e33da5
# processname: smokeping
9e33da5
#
9e33da5
### BEGIN INIT INFO
9e33da5
# Provides: smokeping
9e33da5
# Required-Start: $local_fs $network
9e33da5
# Required-Stop: $local_fs $network
9e33da5
# Default-Start:
9e33da5
# Default-Stop: 0 1 2 3 4 5 6
9e33da5
# Short-Description: Start and stop the smokeping daemon
9e33da5
# Description:  Daemon for smokeping - Latency Logging and Graphing System
9e33da5
### END INIT INFO
9e33da5
#
9e33da5
9e33da5
# Source function library.
9e33da5
. /etc/rc.d/init.d/functions
9e33da5
9e33da5
SMOKEPING=/usr/sbin/smokeping
9e33da5
LOCKF=/var/lock/subsys/smokeping
9e33da5
CONFIG=/etc/smokeping/config
9e33da5
PID=/var/run/smokeping/smokeping.pid
9e33da5
9e33da5
RETVAL=0
9e33da5
9e33da5
case "$1" in
9e33da5
  start)
9e33da5
	[ -x $SMOKEPING ] || exit 5
9e33da5
	[ -f $CONFIG ] || exit 6
9e33da5
	echo -n $"Starting smokeping: "
9e33da5
	daemon $SMOKEPING
9e33da5
	RETVAL=$?
9e33da5
	echo
9e33da5
	[ $RETVAL -eq 0 ] && touch $LOCKF
9e33da5
	;;
9e33da5
  stop)
9e33da5
	echo -n $"Stopping smokeping: "
9e33da5
	killproc $SMOKEPING
9e33da5
	RETVAL=$?
9e33da5
	echo
9e33da5
	[ $RETVAL -eq 0 ] && rm -f $LOCKF $PID
9e33da5
	;;
9e33da5
  status)
9e33da5
	status smokeping
9e33da5
	RETVAL=$?
9e33da5
        ;;
9e33da5
  reload)
9e33da5
	echo -n $"Reloading smokeping: "
9e33da5
	killproc $SMOKEPING -HUP
9e33da5
	RETVAL=$?
9e33da5
	echo
9e33da5
	;;
9e33da5
  restart|force-reload)
9e33da5
	$0 stop
9e33da5
	sleep 3
9e33da5
	$0 start
9e33da5
	RETVAL=$?
9e33da5
	;;
9e33da5
  condrestart|try-restart)
9e33da5
	if [ -f $LOCKF ] ; then
9e33da5
		$0 stop
9e33da5
		sleep 3
9e33da5
		$0 start
9e33da5
		RETVAL=$?
9e33da5
	fi
9e33da5
	;;
9e33da5
  *)
9e33da5
	echo $"Usage: $0 {start|stop|status|restart|force-reload|reload|condrestart|try-restart}"
9e33da5
	exit 1
9e33da5
esac
9e33da5
9e33da5
exit $RETVAL