annotate syslog2iptables.rc.in @ 32:3eb867c9beb2

gpl3
author carl
date Sun, 09 Sep 2007 11:09:05 -0700
parents
children a3fee10284e2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32
carl
parents:
diff changeset
1 # -- bash header installed by automake --
carl
parents:
diff changeset
2 #
carl
parents:
diff changeset
3 # syslog2iptables This script controls the syslog2iptables daemon.
carl
parents:
diff changeset
4 #
carl
parents:
diff changeset
5 #
carl
parents:
diff changeset
6 # chkconfig: 2345 60 40
carl
parents:
diff changeset
7 # description: syslog2iptables monitors syslog files, parses them, and update the iptables filters
carl
parents:
diff changeset
8 # processname: syslog2iptables
carl
parents:
diff changeset
9 # pidfile: /var/run/syslog2iptables.pid
carl
parents:
diff changeset
10 # Source function library.
carl
parents:
diff changeset
11 #
carl
parents:
diff changeset
12 . /etc/rc.d/init.d/functions
carl
parents:
diff changeset
13
carl
parents:
diff changeset
14 # Source networking configuration.
carl
parents:
diff changeset
15 . /etc/sysconfig/network
carl
parents:
diff changeset
16
carl
parents:
diff changeset
17 RETVAL=0
carl
parents:
diff changeset
18 # See how we were called.
carl
parents:
diff changeset
19 case "$1" in
carl
parents:
diff changeset
20 start)
carl
parents:
diff changeset
21 # Start daemons.
carl
parents:
diff changeset
22 echo -n "Starting syslog2iptables: "
carl
parents:
diff changeset
23 if [ ! -f /var/lock/subsys/syslog2iptables ]; then
carl
parents:
diff changeset
24 cd SYSCONFDIR # conf file is here
carl
parents:
diff changeset
25 SBINDIR/syslog2iptables -d 3
carl
parents:
diff changeset
26 RETVAL=$?
carl
parents:
diff changeset
27 pid=`pidof -s SBINDIR/syslog2iptables`
carl
parents:
diff changeset
28 if [ $pid ]
carl
parents:
diff changeset
29 then
carl
parents:
diff changeset
30 success "Starting syslog2iptables :"
carl
parents:
diff changeset
31 touch /var/lock/subsys/syslog2iptables
carl
parents:
diff changeset
32 echo
carl
parents:
diff changeset
33 else
carl
parents:
diff changeset
34 failure "Starting syslog2iptables:"
carl
parents:
diff changeset
35 echo
carl
parents:
diff changeset
36 fi
carl
parents:
diff changeset
37 else
carl
parents:
diff changeset
38 echo -n "already running! "
carl
parents:
diff changeset
39 failure "syslog2iptables already running!"
carl
parents:
diff changeset
40 echo
carl
parents:
diff changeset
41 fi
carl
parents:
diff changeset
42
carl
parents:
diff changeset
43 ;;
carl
parents:
diff changeset
44 stop)
carl
parents:
diff changeset
45 # Stop daemons.
carl
parents:
diff changeset
46 echo -n "Shutting down syslog2iptables: "
carl
parents:
diff changeset
47 killproc syslog2iptables
carl
parents:
diff changeset
48 RETVAL=$?
carl
parents:
diff changeset
49 echo
carl
parents:
diff changeset
50 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/syslog2iptables
carl
parents:
diff changeset
51 ;;
carl
parents:
diff changeset
52 restart|reload)
carl
parents:
diff changeset
53 $0 stop
carl
parents:
diff changeset
54 $0 flush
carl
parents:
diff changeset
55 $0 start
carl
parents:
diff changeset
56 RETVAL=$?
carl
parents:
diff changeset
57 ;;
carl
parents:
diff changeset
58 flush)
carl
parents:
diff changeset
59 /sbin/iptables -F INPUT
carl
parents:
diff changeset
60 ;;
carl
parents:
diff changeset
61 status)
carl
parents:
diff changeset
62 status syslog2iptables
carl
parents:
diff changeset
63 RETVAL=$?
carl
parents:
diff changeset
64 ;;
carl
parents:
diff changeset
65 *)
carl
parents:
diff changeset
66 echo "Usage: syslog2iptables {start|stop|restart|status|flush}"
carl
parents:
diff changeset
67 exit 1
carl
parents:
diff changeset
68 esac
carl
parents:
diff changeset
69 exit $RETVAL
carl
parents:
diff changeset
70
carl
parents:
diff changeset
71 # $Id$