4
# Required-Start: $remote_fs $syslog
5
# Required-Stop: $remote_fs $syslog
6
# Default-Start: 2 3 4 5
8
# Short-Description: ipband daemon
9
# Description: This is a daemon which can monitor as many different subnets (or individual
10
# hosts, by specifying a "subnet" of /32) as you'd like.
13
PATH=/sbin:/bin:/usr/sbin:/usr/bin
14
DAEMON=/usr/sbin/ipband
17
PIDDIR=/var/run/ipband
21
test -x $DAEMON || exit 0
23
if [ -r /etc/default/ipband ]; then
26
printf "/etc/default/ipband is not readable, not starting ipband.\n"
32
printf "Starting $DESC:"
34
for config_file in $CONFIG_FILES; do
35
if [ ! -r "$config_file" ]; then
36
[ "$CONFIG" = "true" ] || CONFIG="false"
39
IDENTIFIER="$(printf "$config_file" | tr / _)"
40
start-stop-daemon --start --background --make-pidfile \
41
--quiet --pidfile "$PIDDIR/$IDENTIFIER.pid" \
42
--exec $DAEMON -- $FLAGS -c "$config_file"
43
printf " $config_file"
46
[ "$CONFIG" = "false" ] && printf " no configuration files found"
50
printf "Stopping $DESC: "
51
for pid_file in $PIDDIR/*.pid; do
52
if [ ! -f "$pid_file" ]; then continue; fi
53
start-stop-daemon --oknodo --stop --quiet --pidfile "$pid_file" \
54
--exec $DAEMON -- $FLAGS && \
65
count=$(ls -1 $PIDDIR/*.pid 2>/dev/null | wc -l)
66
if [ $count -gt 0 ]; then
67
echo -n "ipband is running $count configuration"
68
[ $count -eq 1 ] || echo -n "s"
71
echo "Ipband is not running."
76
echo "Usage: $N {start|stop|restart|force-reload}" >&2