annotate syslog2iptables.rc.in @ 37:e4eb969dfc4a

shutdown removes iptables entries that we added
author carl
date Thu, 08 Nov 2007 11:07:05 -0800
parents 6a2f26976898
children d9ae11033b4b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34
carl
parents: 32
diff changeset
1 #!@BASH@
32
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 start
carl
parents:
diff changeset
55 RETVAL=$?
carl
parents:
diff changeset
56 ;;
carl
parents:
diff changeset
57 status)
carl
parents:
diff changeset
58 status syslog2iptables
carl
parents:
diff changeset
59 RETVAL=$?
carl
parents:
diff changeset
60 ;;
carl
parents:
diff changeset
61 *)
36
6a2f26976898 shutdown removes iptables entries that we added
carl
parents: 34
diff changeset
62 echo "Usage: syslog2iptables {start|stop|restart|reload|status}"
32
carl
parents:
diff changeset
63 exit 1
carl
parents:
diff changeset
64 esac
carl
parents:
diff changeset
65 exit $RETVAL
carl
parents:
diff changeset
66
carl
parents:
diff changeset
67 # $Id$