#!/bin/sh
### BEGIN INIT INFO
# Provides:          FOO
# Required-Start:    $syslog $remote_fs
# Required-Stop:     $syslog $remote_fs
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: rofldns
# Description:       rofldns server
### END INIT INFO
# chkconfig: 2345 85 15
# description: rofldns server

. /etc/rc.status

# Reset status of this service
rc_reset

case "$1" in

start)
	echo -n "Starting DNS services:"
	if [ -f /etc/sysconfig/dnscache ]
	then
	for i in `cat /etc/sysconfig/dnscache `
	do
		startproc "DIR=$i /bin/startcache "
		rc_status -v
	done
	fi

	if [ -f /etc/sysconfig/dnstiny ]
	then
	for i in `cat /etc/sysconfig/dnstiny `
	do
		startproc "DIR=$i /bin/starttiny "
		rc_status -v
	done
	fi
	;;
stop)
	echo -n "Stopping DNS services:"
	killall tinydns
	killall dnscache
	rc_status -v
	;;
restart)
	stop
	start
	;;
*)
	echo "Usage: $0 <start|stop|restart>" 
esac
rc_exit
