#!/bin/bash # # /etc/rc.d/init.d/rarpd # # Starts the rarpd daemon # # chkconfig: - 82 16 # description: Server Reverse Address Resolution Protocol requests. # processname: rarpd # Source function library. . /etc/init.d/functions test -x /usr/sbin/rarpd -a -f /etc/ethers || exit 0 RETVAL=0 prog="rarpd" start() { # Check if rarpd is already running if [ ! -f /var/lock/subsys/rarpd ]; then gprintf "Starting %s: " "$prog" daemon /usr/sbin/rarpd RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/rarpd echo fi return $RETVAL } stop() { gprintf "Stopping %s: " "$prog" killproc /usr/sbin/rarpd RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/rarpd echo return $RETVAL } # # See how we were called. # case "$1" in start) start ;; stop) stop ;; reload|restart) stop start ;; condrestart) if [ -f /var/lock/subsys/rarpd ]; then stop start fi ;; status) status /usr/sbin/rarpd RETVAL=$? ;; *) gprintf "Usage: %s {start|stop|restart|condrestart|reload|status}\n" "$0" exit 1 esac exit $RETVAL