More fixing my code.

master
bbruns 2010-08-23 21:57:03 +00:00
parent c45071c8fb
commit da8f710864
2 changed files with 5 additions and 7 deletions

View File

@ -83,7 +83,7 @@ function iptables_rules_flush {
ipv6) VER_IPTABLES=$IP6TABLES ;;
ipv4|*) VER_IPTABLES=$IPTABLES ;;
esac
display_c RED "Flushing $VER_IPTABLES rules..."
display_c RED "Flushing ${IP_VERSION} rules..."
$VER_IPTABLES --flush &>/dev/null
$VER_IPTABLES -F OUTPUT &>/dev/null
$VER_IPTABLES -F PREROUTING &>/dev/null
@ -97,6 +97,7 @@ function iptables_rules_flush {
# iptables_policy_set (ipv6|ipv4) (ACCEPT|DROP)
# Sets all policy rules to either ACCEPT or DROP for ipv4 or ipv6
# If no policy given, assume ACCEPT
function iptables_policy_reset {
IP_VERSION=$1
SET_POLICY=${2=ACCEPT}
@ -104,6 +105,7 @@ function iptables_policy_reset {
ipv6) VER_IPTABLES=$IP6TABLES ;;
ipv4|*) VER_IPTABLES=$IPTABLES ;;
esac
display_c RED "Setting ${IP_VERSION} policies to ${SET_POLICY}..."
$VER_IPTABLES --policy INPUT $SET_POLICY
$VER_IPTABLES --policy OUTPUT $SET_POLICY
$VER_IPTABLES --policy FORWARD $SET_POLICY
@ -112,12 +114,7 @@ function iptables_policy_reset {
# show_help
# Show command line options help
function show_help {
echo "Firewall/SOSDG ${FW_VERSION}"
echo "Brielle Bruns <bruns@2mbit.com>"
echo "http://www.sosdg.org/freestuff/firewall"
echo "This program comes with ABSOLUTELY NO WARRANTY."
echo "This is free software, and you are welcome to"
echo "redistribute it under certain conditions."
echo "Firewall/SOSDG ${FW_VERSION} - Brielle Bruns <bruns@2mbit.com>"
echo -e "\t--help\t\tShows this info"
echo -e "\t--flush\t\tFlushes all rules back to default ACCEPT"
}

View File

@ -37,6 +37,7 @@ while [ $# -gt 0 ]; do
iptables_policy_reset ipv6 ACCEPT
iptables_rules_flush ipv4
iptables_rules_flush ipv6
exit 0
;;
-h|--help)
show_help