From af526ff43c81257b7938b487ead7469630d675a3 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 13 Apr 2019 22:29:24 -0400 Subject: _get_conf(): Type-check more configuration values --- diff --git a/locale/en_US.sh b/locale/en_US.sh index 458ef5e..3922e4a 100644 --- a/locale/en_US.sh +++ b/locale/en_US.sh @@ -107,3 +107,6 @@ msg_pro_archman_updating_feed='Updating feed %s/%s/%s/%s/%s...' msg_pro_archman_collecting_garbage='Collecting garbage...' msg_pro_archman_collecting_garbage_file='Deleting file %s...' msg_pro_archman_marking_garbage_file='Marking file %s for future deletion...' + +# src/main.sh +msg_pro_archman_conf_invalid='Invalid value for "%s" setting' diff --git a/src/main.sh b/src/main.sh index 3a67c84..7af0810 100644 --- a/src/main.sh +++ b/src/main.sh @@ -125,10 +125,17 @@ _get_conf() fi cd "${old_dir}" + case "${conf_pool_gc_delay}" in *[!0-9]* | '') + error 1 "$(get_msg 'conf_invalid')" 'conf_pool_gc_delay' + esac case "${conf_verbose}" in - 'false' | '0' | 'off' | 'no') conf_verbose=false;; + 'false' | '0' | 'off' | 'no' | '') conf_verbose=false;; *) conf_verbose=true;; esac + case "${conf_gzip}" in + 'false' | '0' | 'off' | 'no' | '') conf_gzip=false;; + *) conf_gzip=true;; + esac return 0 } -- cgit v0.9.1