diff syslog2iptables.rc @ 6:128cae6f3459

initial coding
author carl
date Fri, 02 Dec 2005 18:01:07 -0800
parents
children 390ac4e01472
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/syslog2iptables.rc	Fri Dec 02 18:01:07 2005 -0800
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+# syslog2iptables   This script controls the syslog2iptables daemon.
+#
+#
+# chkconfig: 2345 60 40
+# description: syslog2iptables monitors syslog files, parses them, and update the iptables filters
+# processname: syslog2iptables
+# pidfile: /var/run/syslog2iptables.pid
+# Source function library.
+#
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+    start)
+        # Start daemons.
+        echo -n "Starting syslog2iptables: "
+        if [ ! -f /var/lock/subsys/syslog2iptables ]; then
+            cd /etc         # conf file is here
+            /usr/local/sbin/syslog2iptables -d 10
+            RETVAL=$?
+            pid=`pidof -s /usr/local/sbin/syslog2iptables`
+            if [ $pid ]
+            then
+                success "Starting syslog2iptables :"
+                touch /var/lock/subsys/syslog2iptables
+                echo
+            else
+                failure "Starting syslog2iptables:"
+                echo
+            fi
+        else
+            echo -n "already running! "
+            failure "syslog2iptables already running!"
+            echo
+        fi
+
+        ;;
+    stop)
+        # Stop daemons.
+        echo -n "Shutting down syslog2iptables: "
+        killproc syslog2iptables
+        RETVAL=$?
+        echo
+        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/syslog2iptables
+        ;;
+    restart|reload)
+        $0 stop
+        $0 start
+        RETVAL=$?
+        ;;
+    status)
+        status syslog2iptables
+        RETVAL=$?
+        ;;
+    *)
+        echo "Usage: syslog2iptables {start|stop|restart|status}"
+        exit 1
+esac
+exit $RETVAL
+
+# $Id$