d9debb6
#!/bin/bash
6ced790
#
6ced790
# chkconfig: - 55 45
6ced790
# description:	The arpwatch daemon attempts to keep track of ethernet/ip \
6ced790
#		address pairings.
6ced790
# processname: arpwatch
6ced790
d9debb6
### BEGIN INIT INFO
d9debb6
# Provides: arpwatch
d9debb6
# Required-Start: $network $local_fs $remote_fs
d9debb6
# Required-Stop: $network $local_fs $remote_fs
d9debb6
# Should-Start: $syslog $named
d9debb6
# Should-Stop: $syslog $named
d9debb6
# Short-Description: start and stop arpwatch
d9debb6
# Description: The arpwatch daemon attempts to keep track of ethernet/ip
d9debb6
#              address pairings.
d9debb6
### END INIT INFO
d9debb6
6ced790
# Source function library.
6ced790
. /etc/rc.d/init.d/functions
6ced790
6ced790
# Get config.
6ced790
. /etc/sysconfig/network
6ced790
6ced790
if [ -f /etc/sysconfig/arpwatch ];then 
6ced790
	. /etc/sysconfig/arpwatch
6ced790
fi
6ced790
d9debb6
prog=arpwatch
d9debb6
lockfile=/var/lock/subsys/$prog
6ced790
6ced790
start () {
b1329e8
	# Check that networking is up.
b1329e8
	[ "$NETWORKING" = "no" ] && exit 1
b1329e8
d9debb6
	status $prog > /dev/null && return 0
d9debb6
6ced790
	echo -n $"Starting $prog: "
d9debb6
	daemon $prog $OPTIONS
6ced790
	RETVAL=$?
6ced790
	echo
d9debb6
	[ $RETVAL -eq 0 ] && touch $lockfile
d9debb6
	return $RETVAL
6ced790
}
d9debb6
6ced790
stop () {
6ced790
	echo -n $"Stopping $prog: "
d9debb6
	killproc $prog
6ced790
	RETVAL=$?
6ced790
	echo
d9debb6
	[ $RETVAL -eq 0 ] && rm -f $lockfile
d9debb6
	return $RETVAL
6ced790
}
6ced790
6ced790
# See how we were called.
6ced790
case "$1" in
6ced790
  start)
6ced790
	start
6ced790
	;;
6ced790
  stop)
6ced790
	stop
6ced790
	;;
6ced790
  status)
d9debb6
	status $prog
6ced790
	;;
d9debb6
  restart|force-reload)
d9debb6
	stop
d9debb6
	start
6ced790
	;;
d9debb6
  try-restart|condrestart)
d9debb6
	if status $prog > /dev/null; then
d9debb6
	    stop
d9debb6
	    start
d9debb6
	fi
d9debb6
	;;
d9debb6
  reload)
d9debb6
	exit 3
6ced790
	;;
6ced790
  *)
d9debb6
	echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
d9debb6
	exit 2
6ced790
esac