Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > by-pkgid > 03545bd034afca0e927111f1aa504e51 > files > 6

arpalert-2.0.9-1mdv2008.1.i586.rpm

#!/bin/sh
#
# Startup script for arpalert. This script points
# to the standard arpalert location in /usr/local/arpalert
# This can be changed at the variable ARPALERTHOME.
# Author: Robert Perriero (robert.perriero@gmail.com)
# Date: 03/28/06
# Date: 09/05/06 : Thierry FOURNIER :
#  Include the script in the standard package
#
# chkconfig: - 55 45
# description:  The arpalert daemon attempts to keep track of ethernet/ip \
#               address pairings.
# processname: arpalert

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

prog="arpalert"

start() {
        if [ ! -f /var/run/arpalert.lock ]; then
            gprintf "Starting %s: " "$prog"
            daemon arpalert -d
            RETVAL=$?
            [ $RETVAL -eq 0 ] && touch /var/run/arpalert.lock
            echo
        fi
        return $RETVAL
}

stop() {
        if test "x`pidof arpalert`" != x; then
                gprintf "Stopping %s: " "$prog"
                killproc arpalert
                echo
        fi
        RETVAL=$?
        [ $RETVAL = 0 ] && rm -rf /var/run/arpalert.lock
        return $RETVAL
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    status)
	status arpalert
	RETVAL=$?
	;;		  
    restart|reload)
        stop
        start
        ;;
    *)
        gprintf "Usage: %s {start|stop|status|restart|reload}\n" "$0"
        exit 1
        ;;
esac
exit $?