#!/bin/sh
#
# Startup script for the icmpdnd daemon
#
# chkconfig: 345 13 87
# description: ICMP Domain Name responder daemon for Linux
# processname: icmpdnd
# pidfile: /var/run/icmpdnd.pid
# config: /etc/sysconfig/icmpdnd

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

# Source networking configuration.
. /etc/sysconfig/network

# Check for and source configuration file otherwise set defaults
[ -f /etc/sysconfig/icmpdnd ] && . /etc/sysconfig/icmpdnd

[ -x /sbin/icmpdnd ] || exit 0

# See how we were called.
case "$1" in
  start)
	gprintf "Starting icmpdnd: "
	daemon icmpdnd ${ICMPDND_OPTIONS}
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/icmpdnd
	;;
  stop)
	gprintf "Stopping icmpdnd: "
	killproc icmpdnd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/icmpdnd
	;;
  status)
	status icmpdnd
	RETVAL=$?
	;;
  restart|reload)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  *)
	gprintf "Usage: icmpdnd {start|stop|status|restart|reload}\n"
	exit 1
esac

exit $RETVAL
