forked from extern/shorewall_code
Clean up Generated Program
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3312 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
49cb3fa6c6
commit
62a0cdfb02
@ -8940,10 +8940,6 @@ stop_firewall() {
|
|||||||
$IPTABLES -X
|
$IPTABLES -X
|
||||||
}
|
}
|
||||||
|
|
||||||
setpolicy() {
|
|
||||||
$IPTABLES -P \$1 \$2
|
|
||||||
}
|
|
||||||
|
|
||||||
setcontinue() {
|
setcontinue() {
|
||||||
$IPTABLES -A \$1 -m state --state ESTABLISHED,RELATED -j ACCEPT
|
$IPTABLES -A \$1 -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||||
}
|
}
|
||||||
@ -9314,6 +9310,34 @@ __EOF__
|
|||||||
|
|
||||||
cat >> $RESTOREBASE << __EOF__
|
cat >> $RESTOREBASE << __EOF__
|
||||||
|
|
||||||
|
setpolicy() {
|
||||||
|
$IPTABLES -P \$1 \$2
|
||||||
|
}
|
||||||
|
|
||||||
|
clear_firewall() {
|
||||||
|
stop_firewall
|
||||||
|
|
||||||
|
setpolicy INPUT ACCEPT
|
||||||
|
setpolicy FORWARD ACCEPT
|
||||||
|
setpolicy OUTPUT ACCEPT
|
||||||
|
|
||||||
|
run_iptables -F
|
||||||
|
|
||||||
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||||
|
|
||||||
|
if qt mywhich ip6tables; then
|
||||||
|
ip6tables -P INPUT ACCEPT 2> /dev/null
|
||||||
|
ip6tables -P OUTPUT ACCEPT 2> /dev/null
|
||||||
|
ip6tables -P FORWARD ACCEPT 2> /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
run_user_exit clear
|
||||||
|
|
||||||
|
set_state "Cleared"
|
||||||
|
|
||||||
|
logger "Shorewall Cleared"
|
||||||
|
}
|
||||||
|
|
||||||
fatal_error()
|
fatal_error()
|
||||||
{
|
{
|
||||||
echo " ERROR: \$@" >&2
|
echo " ERROR: \$@" >&2
|
||||||
@ -9360,6 +9384,7 @@ initialize() {
|
|||||||
LOGRULENUMBERS="$LOGRULENUMBERS"
|
LOGRULENUMBERS="$LOGRULENUMBERS"
|
||||||
LOGFORMAT="$LOGFORMAT"
|
LOGFORMAT="$LOGFORMAT"
|
||||||
RESTOREFILE="$RESTOREFILE"
|
RESTOREFILE="$RESTOREFILE"
|
||||||
|
VERSION="$VERSION"
|
||||||
|
|
||||||
STOPPING=
|
STOPPING=
|
||||||
#
|
#
|
||||||
@ -9490,7 +9515,6 @@ __EOF__
|
|||||||
if [ -n "$PROGRAM" ]; then
|
if [ -n "$PROGRAM" ]; then
|
||||||
INDENT=
|
INDENT=
|
||||||
save_command "}"
|
save_command "}"
|
||||||
write_globals
|
|
||||||
save_command ""
|
save_command ""
|
||||||
cat $(find_file prog.header) $RESTOREBASE $(find_file prog.footer) > $outfile
|
cat $(find_file prog.header) $RESTOREBASE $(find_file prog.footer) > $outfile
|
||||||
rm $RESTOREBASE
|
rm $RESTOREBASE
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# Give Usage Information #
|
# Give Usage Information #
|
||||||
################################################################################
|
################################################################################
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 start|stop|reload|restart|status"
|
echo "Usage: $0 start|stop|clear|reload|restart|status|version"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -10,6 +10,44 @@ usage() {
|
|||||||
################################################################################
|
################################################################################
|
||||||
initialize
|
initialize
|
||||||
|
|
||||||
|
finished=0
|
||||||
|
|
||||||
|
while [ $finished -eq 0 ]; do
|
||||||
|
[ $# -eq 0 ] && usage 1
|
||||||
|
option=$1
|
||||||
|
case $option in
|
||||||
|
-*)
|
||||||
|
option=${option#-}
|
||||||
|
|
||||||
|
[ -z "$option" ] && usage 1
|
||||||
|
|
||||||
|
while [ -n "$option" ]; do
|
||||||
|
case $option in
|
||||||
|
q*)
|
||||||
|
QUIET=$(($QUIET + 1 ))
|
||||||
|
option=${option#q}
|
||||||
|
;;
|
||||||
|
n*)
|
||||||
|
NOROUTES=Yes
|
||||||
|
option=${option#n}
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
finished=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
usage 1
|
||||||
|
fi
|
||||||
|
|
||||||
COMMAND="$1"
|
COMMAND="$1"
|
||||||
|
|
||||||
case "$COMMAND" in
|
case "$COMMAND" in
|
||||||
@ -38,7 +76,7 @@ case "$COMMAND" in
|
|||||||
echo "done."
|
echo "done."
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
echo "Shorewall Status at $HOSTNAME - $(date)"
|
echo "Shorewall-$VERSION Status at $HOSTNAME - $(date)"
|
||||||
echo
|
echo
|
||||||
if iptables -L shorewall -n > /dev/null 2>&1; then
|
if iptables -L shorewall -n > /dev/null 2>&1; then
|
||||||
echo "Shorewall is running"
|
echo "Shorewall is running"
|
||||||
@ -61,6 +99,10 @@ case "$COMMAND" in
|
|||||||
echo "State:$state"
|
echo "State:$state"
|
||||||
echo
|
echo
|
||||||
;;
|
;;
|
||||||
|
version)
|
||||||
|
echo $VERSION
|
||||||
|
status=0
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage
|
usage
|
||||||
status=2
|
status=2
|
||||||
|
@ -3,13 +3,11 @@ RCDLINKS="2,S41 3,S41 6,K41"
|
|||||||
#
|
#
|
||||||
# Generated by the Shoreline Firewall (Shorewall) Packet Filtering Firewall - V3.2
|
# Generated by the Shoreline Firewall (Shorewall) Packet Filtering Firewall - V3.2
|
||||||
#
|
#
|
||||||
# Generated $(date) by $USER
|
|
||||||
#
|
|
||||||
# This program is under GPL [http://www.gnu.org/copyleft/gpl.htm]
|
# This program is under GPL [http://www.gnu.org/copyleft/gpl.htm]
|
||||||
#
|
#
|
||||||
# (c) 2006 - Tom Eastep (teastep@shorewall.net)
|
# (c) 2006 - Tom Eastep (teastep@shorewall.net)
|
||||||
#
|
#
|
||||||
# On most distributions, this file should be called /etc/init.d/shorewall.
|
# On most distributions, this file should be called /etc/init.d/firewall.
|
||||||
#
|
#
|
||||||
# Complete documentation is available at http://shorewall.net
|
# Complete documentation is available at http://shorewall.net
|
||||||
#
|
#
|
||||||
@ -37,6 +35,8 @@ RCDLINKS="2,S41 3,S41 6,K41"
|
|||||||
# clear Removes all firewall rules
|
# clear Removes all firewall rules
|
||||||
# stop Stops the firewall
|
# stop Stops the firewall
|
||||||
# status Displays firewall status
|
# status Displays firewall status
|
||||||
|
# version Displays the version of Shorewall that
|
||||||
|
# generated this program
|
||||||
#
|
#
|
||||||
|
|
||||||
# chkconfig: 2345 25 90
|
# chkconfig: 2345 25 90
|
||||||
|
Loading…
Reference in New Issue
Block a user