#!/bin/bash
#
# I, Jan Labanowski, grabbed this script from RedHat 7.1 ipchains distribution
# and totally messed it up by removing all the fancy stuff and checking.
# One day {(;-)} I will do the real script.
#
# chkconfig: 2345 11 89
#
# description: Automates a packet filtering firewall with iptables.
#
# Script Author: Joshua Jensen
# -- hacked up by gafton with help from notting
#
# I assume that iptables reside in /usr/bin/iptables, are owned by root
# and have permission 700
#
case "$1" in
start)
/usr/sbin/flushfw
/usr/sbin/startfw
echo iptables are now running
;;
stop)
/usr/sbin/flushfw
echo iptables are now stopped
;;
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)
/usr/sbin/iplisting
;;
panic)
/usr/sbin/flushfw
echo iptables are now stopped
;;
*)
echo $"Usage: $0 {start|stop|restart|status|panic}"
exit 1
esac
exit 0
|