From 36c0bad1fa4d61860a9cb4688759a49fa22cde67 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 28 Sep 2005 12:52:36 +0000 Subject: Initial revision --- scripts/mandi.init | 45 +++++++++++++++++++++++++++++++++++++++++++++ scripts/start | 5 +++++ scripts/stop | 3 +++ 3 files changed, 53 insertions(+) create mode 100644 scripts/mandi.init create mode 100644 scripts/start create mode 100644 scripts/stop (limited to 'scripts') diff --git a/scripts/mandi.init b/scripts/mandi.init new file mode 100644 index 0000000..1fa205c --- /dev/null +++ b/scripts/mandi.init @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Startup script for the mandi daemon (oblin@mandriva.com) +# +# chkconfig: 2345 26 59 +# +# description: Network monitoring daemon (Interactive Firewall and wireless) +# +# + +. /etc/init.d/functions + +case "$1" in + start) + gprintf "Starting mandi daemon: " + daemon /usr/sbin/mandi -d + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mandi + ;; + stop) + gprintf "Shutting down mandi daemon: " + killproc mandi + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/mandi + ;; + status) + status mandi + RETVAL=$? + ;; + restart|reload) + $0 stop + $0 start + ;; + condrestart) + [ -f /var/lock/subsys/mandi ] && restart || : + ;; + *) + gprintf "Usage: %s {start|stop|status|restart}\n" "$0" + RETVAL=1 + ;; +esac + +exit $RETVAL diff --git a/scripts/start b/scripts/start new file mode 100644 index 0000000..b416e8b --- /dev/null +++ b/scripts/start @@ -0,0 +1,5 @@ +iptables -N Ifw +ipset -N ifw_wl iptree +iptables -A Ifw -m set --set ifw_wl src -j RETURN +ipset -N ifw_bl iptree --timeout 3600 +iptables -A Ifw -m set --set ifw_bl src -j DROP diff --git a/scripts/stop b/scripts/stop new file mode 100644 index 0000000..1e9af67 --- /dev/null +++ b/scripts/stop @@ -0,0 +1,3 @@ +ipset -X ifw_bl +ipset -X ifw_wl +iptables -X Ifw -- cgit v1.2.1