From da8f7108648574d5921ba2d8fbba67313875e4c9 Mon Sep 17 00:00:00 2001 From: bbruns Date: Mon, 23 Aug 2010 21:57:03 +0000 Subject: [PATCH] More fixing my code. --- include/functions | 11 ++++------- rc.firewall | 1 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/functions b/include/functions index bcb33e9..9bc3dd3 100644 --- a/include/functions +++ b/include/functions @@ -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 " - 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 " echo -e "\t--help\t\tShows this info" echo -e "\t--flush\t\tFlushes all rules back to default ACCEPT" } \ No newline at end of file diff --git a/rc.firewall b/rc.firewall index 1a4dfe7..94639f8 100755 --- a/rc.firewall +++ b/rc.firewall @@ -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