File: dnsflood

package info (click to toggle)
dns-flood-detector 1.20-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 216 kB
  • sloc: ansic: 737; perl: 102; sh: 75; makefile: 50
file content (36 lines) | stat: -rwxr-xr-x 1,035 bytes parent folder | download | duplicates (11)
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