From e10c078a062e878ff7ab0e14f3d9df14165f3ec6 Mon Sep 17 00:00:00 2001 From: Tuomo Soini Date: Mon, 8 Jun 2015 22:23:38 +0300 Subject: [PATCH] Set exit code to 6 when startup is disabled Handles cases missed by 4b27c72c7944043a73261f1f8310fe5c1e89daec Signed-off-by: Tuomo Soini --- Shorewall/lib.cli-std | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Shorewall/lib.cli-std b/Shorewall/lib.cli-std index cce2c1755..6dc804468 100644 --- a/Shorewall/lib.cli-std +++ b/Shorewall/lib.cli-std @@ -162,14 +162,13 @@ get_config() { if [ "$2" = Yes ]; then case $STARTUP_ENABLED in No|no|NO) - fatal_error "$g_product startup is disabled. To enable startup, set STARTUP_ENABLED=Yes in ${g_confdir}/${g_program}.conf" + not_configured "$g_product startup is disabled. To enable startup, set STARTUP_ENABLED=Yes in ${g_confdir}/${g_program}.conf" ;; Yes|yes|YES) ;; *) if [ -n "$STARTUP_ENABLED" ]; then - fatal_error "Invalid Value for STARTUP_ENABLED: $STARTUP_ENABLED" - exit 6 + not_configured "Invalid Value for STARTUP_ENABLED: $STARTUP_ENABLED" fi ;; esac @@ -497,7 +496,7 @@ start_command() { exit 0 fi - [ -n "$STARTUP_ENABLED" ] || fatal_error "Startup is disabled" + [ -n "$STARTUP_ENABLED" ] || not_configured "Startup is disabled" while [ $finished -eq 0 -a $# -gt 0 ]; do option=$1 @@ -989,7 +988,7 @@ restart_command() { ;; esac - [ -n "$STARTUP_ENABLED" ] || fatal_error "Startup is disabled" + [ -n "$STARTUP_ENABLED" ] || not_configured "Startup is disabled" if [ -z "$g_fast" -a -n "$AUTOMAKE" ]; then uptodate ${VARDIR}/firewall && g_fast=Yes @@ -1088,7 +1087,7 @@ refresh_command() { product_is_started || fatal_error "$g_product is not running" - [ -n "$STARTUP_ENABLED" ] || fatal_error "Startup is disabled" + [ -n "$STARTUP_ENABLED" ] || not_configured "Startup is disabled" if compiler $g_debugging $nolock compile ${VARDIR}/.refresh; then run_postcompile ${VARDIR}/.refresh @@ -1177,7 +1176,7 @@ safe_commands() { ;; esac - [ -n "$STARTUP_ENABLED" ] || fatal_error "Startup is disabled" + [ -n "$STARTUP_ENABLED" ] || not_configured "Startup is disabled" if product_is_started; then running=Yes @@ -1314,7 +1313,7 @@ try_command() { ;; esac - [ -n "$STARTUP_ENABLED" ] || fatal_error "Startup is disabled" + [ -n "$STARTUP_ENABLED" ] || not_configured "Startup is disabled" if product_is_started; then running=Yes