Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates-src > by-pkgid > f4a32d274e3095c383b240ddffa03ec8 > files > 9

arpwatch-2.1a15-18.1.mga7.src.rpm

#!/bin/bash
#
# chkconfig: 2345 55 45
# description:	The arpwatch daemon attempts to keep track of ethernet/ip \
#		address pairings.
# processname: arpwatch
#
### BEGIN INIT INFO
# Provides: arpwatch
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Short-Description: The arpwatch daemon
# Description: The arpwatch daemon keeps track of ethernet/ip address pairings
### END INIT INFO

# define gprintf for distros without it:
gprintf() {
		printf -- "$@"
}
prog=arpwatch

# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = "no" ]
then
	exit 0
fi

[ -x /usr/sbin/arpwatch ] || exit 0

# Source configuration file
[ -f /etc/sysconfig/arpwatch ] && . /etc/sysconfig/arpwatch

RETVAL=0

# See how we were called.
case "$1" in
  start)
	gprintf "Starting %s: " "$prog"
	daemon arpwatch \
	${ARPWATCH_INTERFACE:-""} \
	${ARPWATCH_LOCAL_NETWORKS:-""} \
	${ARPWATCH_NO_REPORTING:-""} \
	${ARPWATCH_NO_IP:-""} \
	${ARPWATCH_UID:-""} \
	${ARPWATCH_EMAIL_TO:-""} \
	${ARPWATCH_EMAIL_FROM:-""} \
	${ARPWATCH_OPTIONS:-""}
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/arpwatch
	;;
  stop)
	gprintf "Stopping %s: " "$prog"
	killproc arpwatch
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/arpwatch
	;;
  status)
	status arpwatch
	RETVAL=$?
	;;
  restart|reload)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  debug)
	arpwatch -d
	RETVAL=$?
	;;
  *)
	gprintf "Usage: %s\n" "$prog {start|stop|status|restart|reload|debug}"
	exit 1
esac

exit $RETVAL