From fb8f8d11e0ccd6ce35419bf4a3208bd1ed353a68 Mon Sep 17 00:00:00 2001 From: bbruns Date: Wed, 25 Aug 2010 17:56:18 +0000 Subject: [PATCH] More error checking --- rc.firewall | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/rc.firewall b/rc.firewall index d13f85f..1169d81 100755 --- a/rc.firewall +++ b/rc.firewall @@ -26,8 +26,23 @@ BASEDIR=/etc/firewall-sosdg TWEAKS=$BASEDIR/tweaks +if [ ! -r $BASEDIR/include/static ] || [ ! -r $BASEDIR/include/functions ]; then + echo "Error: Missing either include/static or include/functions. These are critical to operation" + echo "of this script. Please make sure they are readable and exist!" + exit 1 +fi + + . $BASEDIR/include/static -. $BASEDIR/options + + +if [ -r $BASEDIR/options ]; then + . $BASEDIR/options +else + echo -e "${RED}Error: Can not load options file. Did you forget to rename options.default?" + exit 1 +fi + . $BASEDIR/include/functions while [ $# -gt 0 ]; do