#!/bin/sh
#
# Script Author: Joshua Jensen <joshua@redhat.com>
# -- hacked up by gafton with help from notting
# messed with again by kevin krkosska on August the 7th of 2001
#
if [ ! -x /root/fwk-inet.sh ]; then
/bin/echo "No /root/fwk-inet.sh file"
exit 0
fi
if [ ! -x /sbin/ipchains ]; then
/bin/echo "No ipchains binary!"
exit 0
fi
case "$1" in
start)
/bin/echo "Flushing all current rules and user defined chains:"
/bin/echo "Clearing all current rules and user defined chains:"
/sbin/ipchains -F
/sbin/ipchains -X
/sbin/ipchains -Z
echo -n "Applying ipchains firewall rules: "
/bin/sh /root/fwk-inet.sh
/bin/echo " "
;;
stop)
/bin/echo "Flushing all chains:"
/sbin/ipchains -F
/bin/echo "Removing user defined chains:"
/sbin/ipchains -X
echo -n "Resetting built-in chains to the default ACCEPT policy:"
/sbin/ipchains -P input ACCEPT
/sbin/ipchains -P forward ACCEPT
/sbin/ipchains -P output ACCEPT
/bin/echo " "
;;
restart)
# "restart" is really just "start" as this isn't a daemon,
# and "start" clears any pre-defined rules anyway.
# This is really only here to make those who expect it happy
$0 start
;;
status)
/sbin/ipchains -nL --line-numbers |less
;;
panic)
/bin/echo -n "Changing target policies to DENY: "
/sbin/ipchains -P input DENY
/sbin/ipchains -P forward DENY
/sbin/ipchains -P output DENY
/bin/echo "Changing target policies to DENY"
/bin/echo "Flushing all chains:"
/sbin/ipchains -F
/bin/echo "Removing user defined chains:"
/sbin/ipchains -X
/bin/echo ""
;;
*)
echo "Usage: $0 {start|stop|restart|status|panic}"
exit 1
esac
exit 0
www.fiveanddime.net