37 lines
1 KiB
Plaintext
37 lines
1 KiB
Plaintext
|
#! /bin/sh
|
||
|
|
||
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||
|
|
||
|
test -f /usr/local/sbin/dns_flood_detector || exit 0
|
||
|
|
||
|
case "$1" in
|
||
|
start)
|
||
|
echo -n "Starting DNS flood detector: dns_flood_detector"
|
||
|
start-stop-daemon --start --quiet --exec /usr/local/sbin/dns_flood_detector -- -d
|
||
|
echo "."
|
||
|
;;
|
||
|
stop)
|
||
|
echo -n "Stopping DNS flood detector: dns_flood_detector"
|
||
|
start-stop-daemon --stop --quiet --exec /usr/local/sbin/dns_flood_detector
|
||
|
killall dns_flood_detector
|
||
|
echo "."
|
||
|
;;
|
||
|
restart|force-reload)
|
||
|
echo -n "Restarting DNS flood detector: dns_flood_detector... "
|
||
|
start-stop-daemon --stop --quiet --exec /usr/local/sbin/dns_flood_detector
|
||
|
sleep 2
|
||
|
start-stop-daemon --stop --quiet --exec /usr/local/sbin/dns_flood_detector
|
||
|
sleep 4
|
||
|
killall dns_flood_detector
|
||
|
sleep 2
|
||
|
start-stop-daemon --start --quiet --exec /usr/local/sbin/dns_flood_detector -- -d
|
||
|
echo "done."
|
||
|
;;
|
||
|
*)
|
||
|
echo "Usage: /etc/init.d/dnsflood {start|stop|restart|force-reload}"
|
||
|
exit 1
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
exit 0
|