1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#! /bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=guarddog
#test -x /etc/rc.firewall || exit 0
if [ ! -f /etc/rc.firewall ]; then
echo "Unable to start guarddog firewall - /etc/rc.firewall does not exist"
exit 0
fi
set -e
case "$1" in
start|restart|reload|force-reload)
echo -n "Setting up guarddog firewall..."
/bin/bash /etc/rc.firewall
echo "done."
;;
stop)
if [ -x /sbin/iptables ]; then
echo -n "Stopping iptables firewall..."
iptables -P OUTPUT ACCEPT
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -X
echo "done."
exit 0;
fi
if [ -x /sbin/ipchains ]; then
echo -n "Stopping ipchains firewall..."
ipchains -P output ACCEPT
ipchains -P input ACCEPT
ipchains -P forward ACCEPT
ipchains -F
ipchains -X
echo "done."
exit 0;
fi
echo "Cannot find /sbin/ipchains or /sbin/iptables"
exit 1
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0
|