X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=admin%2Ficmpdnd;fp=admin%2Ficmpdnd;h=7cd3ef9b9d0730c6553bc69c69baecab2cb07d60;hb=388db5631dc33ab5b1eaad1bd5d98c34f87971f0;hp=0000000000000000000000000000000000000000;hpb=ce25dc6fa4ca91274bef2e3cbd327d4aefbb0e34;p=icmp-dn.git diff --git a/admin/icmpdnd b/admin/icmpdnd new file mode 100755 index 0000000..7cd3ef9 --- /dev/null +++ b/admin/icmpdnd @@ -0,0 +1,77 @@ +#!/bin/bash +# +# icmpdnd This shell script takes care of starting and stopping +# icmpdnd. +# +# chkconfig: - 13 87 +# description: icmpdnd ICMP Domain Name responder daemon for Linux +# processname: icmpdnd +# pidfile: /var/run/icmpdnd.pid + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network + +# Source icmpdn configureation. +if [ -f /etc/sysconfig/icmpdnd ] ; then + . /etc/sysconfig/icmpdnd +fi + +# Check that networking is up. +[ "${NETWORKING}" = "no" ] && exit 0 + +[ -f /usr/sbin/icmpdnd ] || exit 0 + +RETVAL=0 +prog="icmpdnd" + +start() { + echo -n $"Starting $prog: " + daemon /usr/sbin/icmpdnd $ICMPDND_OPTS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/icmpdnd + return $RETVAL +} + +stop() { + echo -n $"Shutting down $prog: " + killproc "$prog" + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/icmpdnd + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + RETVAL=$? + ;; + condrestart) + if [ -f /var/lock/subsys/icmpdnd ]; then + stop + start + RETVAL=$? + fi + ;; + status) + status icmpdnd + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 +esac + +exit $RETVAL