diff --git a/Shorewall/lib.common b/Shorewall/lib.common index 2c58d0102..1c3d304c4 100644 --- a/Shorewall/lib.common +++ b/Shorewall/lib.common @@ -435,11 +435,7 @@ find_first_interface_address() # $1 = interface # # If there wasn't one, bail out now # - if [ -z "$addr" ]; then - echo " ERROR: Can't determine the IP address of $1" >&2 - kill $$ - exit 1 - fi + [ -n "$addr" ] || startup_error "Can't determine the IP address of $1" # # Strip off the trailing VLSM mask (or the peer IP in case of a P-t-P link) # along with everything else on the line diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 34724b3f7..e63278858 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -300,15 +300,20 @@ get_config() { esac } +# +# Fatal error +# +startup_error() { + echo " ERROR: $@" >&2 + kill $$ + exit 1 +} + # # Run the compiler # compiler() { - startup_error() { - echo " ERROR: $@" >&2 - exit 1 - } - + if [ $(id -u) -ne 0 ]; then if [ -z "$SHOREWALL_DIR" -o "$SHOREWALL_DIR" = /etc/shorewall ]; then startup_error "Ordinary users may not compile the /etc/shorewall configuration"