From 4df28dc910b9e1674ded535bb65604f8d4852747 Mon Sep 17 00:00:00 2001 From: bbruns Date: Fri, 28 Oct 2011 21:41:09 +0000 Subject: [PATCH] Begin minor cleanup work for 1.0 --- ChangeLog | 1 + bin/firewall-sosdg | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ddb286..34d851f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ we're not really going to need to track connections forwarding through the system. I can probably be proven wrong if you don't use NAT but use the script for stateful firewalling with non-RFC1918 IPs.... + - Cleanup work on code for v1.0 0.9.13 - Brielle Bruns - Fix location of ipv6 fi statement, moved to end of ipv6 rules diff --git a/bin/firewall-sosdg b/bin/firewall-sosdg index 291c14e..ee79d4d 100755 --- a/bin/firewall-sosdg +++ b/bin/firewall-sosdg @@ -46,8 +46,12 @@ if [ ! -r $BASEDIR/include/static ] || [ ! -r $BASEDIR/include/functions ]; then exit 1 fi -. $BASEDIR/include/static - +if [ -r $BASEDIR/include/static ]; then + . $BASEDIR/include/static +else + echo -e "${RED}Error: Can not load static variables file. There is no way to make this tool work without it." + exit 1 +fi if [ -r $BASEDIR/options ]; then . $BASEDIR/options @@ -131,13 +135,13 @@ fi iptables_rules_flush ipv4 -if [ -s "$BASEDIR/include/ipv4_custom_flush" ]; then +if [ -s "${BASEDIR}/include/ipv4_custom_flush" ]; then display_c YELLOW "Loading custom flush rules..." - . "$BASEDIR/include/ipv4_custom_flush" + . "${BASEDIR}/include/ipv4_custom_flush" fi -if [ -x "$PRERUN" ]; then - $PRERUN +if [ -x "${PRERUN}" ]; then + ${PRERUN} fi if [ "$MODULES_LOAD" ]; then @@ -164,6 +168,9 @@ else C_STATE="--ctstate" fi +# This function currently isn't implemented entirely or properly. It's mostly +# used for debugging purposes, and to see what iptables rules will be generated +# before running. if [ "$GEN_CACHE" ]; then case $GEN_CACHE in force)