Signed-off-by: Matt Darfeuille <[email protected]>
---
 Shorewall-core/install.sh    |  8 ++++----
 Shorewall-core/uninstall.sh  | 10 +++++-----
 Shorewall-init/install.sh    | 18 +++++++++---------
 Shorewall-init/uninstall.sh  | 11 ++++++-----
 Shorewall-lite/install.sh    | 12 +++++++-----
 Shorewall-lite/uninstall.sh  | 11 ++++++-----
 Shorewall/install.sh         | 13 ++++++++-----
 Shorewall/uninstall.sh       | 13 ++++++++-----
 Shorewall6-lite/uninstall.sh | 11 ++++++-----
 Shorewall6/uninstall.sh      | 10 +++++-----
 10 files changed, 64 insertions(+), 53 deletions(-)

diff --git a/Shorewall-core/install.sh b/Shorewall-core/install.sh
index 6b7bce7..da9be32 100755
--- a/Shorewall-core/install.sh
+++ b/Shorewall-core/install.sh
@@ -104,14 +104,14 @@ done
 #
 if [ $# -eq 0 ]; then
     if [ -f ./shorewallrc ]; then
-       . ./shorewallrc
        file=./shorewallrc
+        . $file || fatal_error "Can not load the RC file: $file"
     elif [ -f ~/.shorewallrc ]; then
-       . ~/.shorewallrc || exit 1
        file=~/.shorewallrc
+        . $file || fatal_error "Can not load the RC file: $file"
     elif [ -f /usr/share/shorewall/shorewallrc ]; then
-       . /usr/share/shorewall/shorewallrc
        file=/usr/share/shorewall/shorewallrc
+        . $file || fatal_error "Can not load the RC file: $file"
     else
        fatal_error "No configuration file specified and 
/usr/share/shorewall/shorewallrc not found"
     fi
@@ -125,7 +125,7 @@ elif [ $# -eq 1 ]; then
            ;;
     esac
 
-    . $file
+    . $file || fatal_error "Can not load the RC file: $file"
 else
     usage 1
 fi
diff --git a/Shorewall-core/uninstall.sh b/Shorewall-core/uninstall.sh
index 2a12252..ef0f3dd 100755
--- a/Shorewall-core/uninstall.sh
+++ b/Shorewall-core/uninstall.sh
@@ -52,11 +52,11 @@ cd "$(dirname $0)"
 #
 if [ $# -eq 0 ]; then
     if [ -f ./shorewallrc ]; then
-       . ./shorewallrc
+        . ./shorewallrc || fatal_error "Can not load the RC file: 
./shorewallrc"
     elif [ -f ~/.shorewallrc ]; then
-       . ~/.shorewallrc || exit 1
+        . ~/.shorewallrc || fatal_error "Can not load the RC file: 
~/.shorewallrc"
     elif [ -f /usr/share/shorewall/shorewallrc ]; then
-       . /usr/share/shorewall/shorewallrc
+        . /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC 
file: /usr/share/shorewall/shorewallrc"
     else
        fatal_error "No configuration file specified and 
/usr/share/shorewall/shorewallrc not found"
     fi
@@ -66,11 +66,11 @@ elif [ $# -eq 1 ]; then
        /*|.*)
            ;;
        *)
-           file=./$file
+           file=./$file || exit 1
            ;;
     esac
 
-    . $file
+    . $file || fatal_error "Can not load the RC file: $file"
 else
     usage 1
 fi
diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh
index 8cbfcb3..35248fc 100755
--- a/Shorewall-init/install.sh
+++ b/Shorewall-init/install.sh
@@ -114,17 +114,17 @@ done
 # Read the RC file
 #
 if [ $# -eq 0 ]; then
-    #
-    # Load packager's settings if any
-    #
     if [ -f ./shorewallrc ]; then
-       . ./shorewallrc || exit 1
        file=./shorewallrc
+        . $file || fatal_error "Can not load the RC file: $file"
     elif [ -f ~/.shorewallrc ]; then
-       . ~/.shorewallrc || exit 1
        file=~/.shorewallrc
-     else
-       fatal_error "No configuration file specified and ~/.shorewallrc not 
found"
+        . $file || fatal_error "Can not load the RC file: $file"
+    elif [ -f /usr/share/shorewall/shorewallrc ]; then
+       file=/usr/share/shorewall/shorewallrc
+        . $file || fatal_error "Can not load the RC file: $file"
+    else
+       fatal_error "No configuration file specified and 
/usr/share/shorewall/shorewallrc not found"
     fi
 elif [ $# -eq 1 ]; then
     file=$1
@@ -132,11 +132,11 @@ elif [ $# -eq 1 ]; then
        /*|.*)
            ;;
        *)
-           file=./$file
+           file=./$file || exit 1
            ;;
     esac
 
-    . $file
+    . $file || fatal_error "Can not load the RC file: $file"
 else
     usage 1
 fi
diff --git a/Shorewall-init/uninstall.sh b/Shorewall-init/uninstall.sh
index 76de74a..e2f64da 100755
--- a/Shorewall-init/uninstall.sh
+++ b/Shorewall-init/uninstall.sh
@@ -83,16 +83,17 @@ while [ $finished -eq 0 ]; do
            ;;
     esac
 done
+
 #
 # Read the RC file
 #
 if [ $# -eq 0 ]; then
     if [ -f ./shorewallrc ]; then
-       . ./shorewallrc
+        . ./shorewallrc || fatal_error "Can not load the RC file: 
./shorewallrc"
     elif [ -f ~/.shorewallrc ]; then
-       . ~/.shorewallrc || exit 1
+        . ~/.shorewallrc || fatal_error "Can not load the RC file: 
~/.shorewallrc"
     elif [ -f /usr/share/shorewall/shorewallrc ]; then
-       . /usr/share/shorewall/shorewallrc
+        . /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC 
file: /usr/share/shorewall/shorewallrc"
     else
        fatal_error "No configuration file specified and 
/usr/share/shorewall/shorewallrc not found"
     fi
@@ -102,11 +103,11 @@ elif [ $# -eq 1 ]; then
        /*|.*)
            ;;
        *)
-           file=./$file
+           file=./$file || exit 1
            ;;
     esac
 
-    . $file || exit 1
+    . $file || fatal_error "Can not load the RC file: $file"
 else
     usage 1
 fi
diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh
index 0208127..76f8271 100755
--- a/Shorewall-lite/install.sh
+++ b/Shorewall-lite/install.sh
@@ -116,12 +116,14 @@ done
 #
 if [ $# -eq 0 ]; then
     if [ -f ./shorewallrc ]; then
-       . ./shorewallrc || exit 1
        file=./shorewallrc
+        . $file || fatal_error "Can not load the RC file: $file"
     elif [ -f ~/.shorewallrc ]; then
-       . ~/.shorewallrc
+       file=~/.shorewallrc
+        . $file || fatal_error "Can not load the RC file: $file"
     elif [ -f /usr/share/shorewall/shorewallrc ]; then
-       . /usr/share/shorewall/shorewallrc
+       file=/usr/share/shorewall/shorewallrc
+        . $file || fatal_error "Can not load the RC file: $file"
     else
        fatal_error "No configuration file specified and 
/usr/share/shorewall/shorewallrc not found"
     fi
@@ -131,11 +133,11 @@ elif [ $# -eq 1 ]; then
        /*|.*)
            ;;
        *)
-           file=./$file
+           file=./$file || exit 1
            ;;
     esac
 
-    . $file
+    . $file || fatal_error "Can not load the RC file: $file"
 else
     usage 1
 fi
diff --git a/Shorewall-lite/uninstall.sh b/Shorewall-lite/uninstall.sh
index 4b57116..e4f8a22 100755
--- a/Shorewall-lite/uninstall.sh
+++ b/Shorewall-lite/uninstall.sh
@@ -87,16 +87,17 @@ while [ $finished -eq 0 ]; do
            ;;
     esac
 done
+
 #
 # Read the RC file
 #
 if [ $# -eq 0 ]; then
     if [ -f ./shorewallrc ]; then
-       . ./shorewallrc
+        . ./shorewallrc || fatal_error "Can not load the RC file: 
./shorewallrc"
     elif [ -f ~/.shorewallrc ]; then
-       . ~/.shorewallrc || exit 1
+        . ~/.shorewallrc || fatal_error "Can not load the RC file: 
~/.shorewallrc"
     elif [ -f /usr/share/shorewall/shorewallrc ]; then
-       . /usr/share/shorewall/shorewallrc
+        . /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC 
file: /usr/share/shorewall/shorewallrc"
     else
        fatal_error "No configuration file specified and 
/usr/share/shorewall/shorewallrc not found"
     fi
@@ -106,11 +107,11 @@ elif [ $# -eq 1 ]; then
        /*|.*)
            ;;
        *)
-           file=./$file
+           file=./$file || exit 1
            ;;
     esac
 
-    . $file
+    . $file || fatal_error "Can not load the RC file: $file"
 else
     usage 1
 fi
diff --git a/Shorewall/install.sh b/Shorewall/install.sh
index fccb278..a28a8de 100755
--- a/Shorewall/install.sh
+++ b/Shorewall/install.sh
@@ -129,11 +129,14 @@ done
 #
 if [ $# -eq 0 ]; then
     if [ -f ./shorewallrc ]; then
-       . ./shorewallrc
+       file=./shorewallrc
+        . $file || fatal_error "Can not load the RC file: $file"
     elif [ -f ~/.shorewallrc ]; then
-       . ~/.shorewallrc || exit 1
+       file=~/.shorewallrc
+        . $file || fatal_error "Can not load the RC file: $file"
     elif [ -f /usr/share/shorewall/shorewallrc ]; then
-       . /usr/share/shorewall/shorewallrc
+       file=/usr/share/shorewall/shorewallrc
+        . $file || fatal_error "Can not load the RC file: $file"
     else
        fatal_error "No configuration file specified and 
/usr/share/shorewall/shorewallrc not found"
     fi
@@ -143,11 +146,11 @@ elif [ $# -eq 1 ]; then
        /*|.*)
            ;;
        *)
-           file=./$file
+           file=./$file || exit 1
            ;;
     esac
 
-    . $file
+    . $file || fatal_error "Can not load the RC file: $file"
 else
     usage 1
 fi
diff --git a/Shorewall/uninstall.sh b/Shorewall/uninstall.sh
index f291b7f..05e7d73 100755
--- a/Shorewall/uninstall.sh
+++ b/Shorewall/uninstall.sh
@@ -88,13 +88,16 @@ while [ $finished -eq 0 ]; do
     esac
 done
 
+#
+# Read the RC file
+#
 if [ $# -eq 0 ]; then
     if [ -f ./shorewallrc ]; then
-       . ./shorewallrc
+        . ./shorewallrc || fatal_error "Can not load the RC file: 
./shorewallrc"
     elif [ -f ~/.shorewallrc ]; then
-       . ~/.shorewallrc || exit 1
+        . ~/.shorewallrc || fatal_error "Can not load the RC file: 
~/.shorewallrc"
     elif [ -f /usr/share/shorewall/shorewallrc ]; then
-       . /usr/share/shorewall/shorewallrc
+        . /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC 
file: /usr/share/shorewall/shorewallrc"
     else
        fatal_error "No configuration file specified and 
/usr/share/shorewall/shorewallrc not found"
     fi
@@ -104,11 +107,11 @@ elif [ $# -eq 1 ]; then
        /*|.*)
            ;;
        *)
-           file=./$file
+           file=./$file || exit 1
            ;;
     esac
 
-    . $file
+    . $file || fatal_error "Can not load the RC file: $file"
 else
     usage 1
 fi
diff --git a/Shorewall6-lite/uninstall.sh b/Shorewall6-lite/uninstall.sh
index 6d0ee50..6a302f6 100755
--- a/Shorewall6-lite/uninstall.sh
+++ b/Shorewall6-lite/uninstall.sh
@@ -83,16 +83,17 @@ while [ $finished -eq 0 ]; do
            ;;
     esac
 done
+
 #
 # Read the RC file
 #
 if [ $# -eq 0 ]; then
     if [ -f ./shorewallrc ]; then
-       . ./shorewallrc
+        . ./shorewallrc || fatal_error "Can not load the RC file: 
./shorewallrc"
     elif [ -f ~/.shorewallrc ]; then
-       . ~/.shorewallrc || exit 1
+        . ~/.shorewallrc || fatal_error "Can not load the RC file: 
~/.shorewallrc"
     elif [ -f /usr/share/shorewall/shorewallrc ]; then
-       . /usr/share/shorewall/shorewallrc
+        . /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC 
file: /usr/share/shorewall/shorewallrc"
     else
        fatal_error "No configuration file specified and 
/usr/share/shorewall/shorewallrc not found"
     fi
@@ -102,11 +103,11 @@ elif [ $# -eq 1 ]; then
        /*|.*)
            ;;
        *)
-           file=./$file
+           file=./$file || exit 1
            ;;
     esac
 
-    . $file
+    . $file || fatal_error "Can not load the RC file: $file"
 else
     usage 1
 fi
diff --git a/Shorewall6/uninstall.sh b/Shorewall6/uninstall.sh
index 20ac1c2..b0368a6 100755
--- a/Shorewall6/uninstall.sh
+++ b/Shorewall6/uninstall.sh
@@ -89,11 +89,11 @@ done
 #
 if [ $# -eq 0 ]; then
     if [ -f ./shorewallrc ]; then
-       . ./shorewallrc
+        . ./shorewallrc || fatal_error "Can not load the RC file: 
./shorewallrc"
     elif [ -f ~/.shorewallrc ]; then
-       . ~/.shorewallrc || exit 1
+        . ~/.shorewallrc || fatal_error "Can not load the RC file: 
~/.shorewallrc"
     elif [ -f /usr/share/shorewall/shorewallrc ]; then
-       . /usr/share/shorewall/shorewallrc
+        . /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC 
file: /usr/share/shorewall/shorewallrc"
     else
        fatal_error "No configuration file specified and 
/usr/share/shorewall/shorewallrc not found"
     fi
@@ -103,11 +103,11 @@ elif [ $# -eq 1 ]; then
        /*|.*)
            ;;
        *)
-           file=./$file
+           file=./$file || exit 1
            ;;
     esac
 
-    . $file
+    . $file || fatal_error "Can not load the RC file: $file"
 else
     usage 1
 fi
-- 
2.8.3


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to