-
Notifications
You must be signed in to change notification settings - Fork 4
/
dnsflood
executable file
·36 lines (32 loc) · 1.01 KB
/
dnsflood
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /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