diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-13 22:29:24 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-13 22:29:24 (EDT) |
commit | af526ff43c81257b7938b487ead7469630d675a3 (patch) | |
tree | de9063c19739023aef6735b667a2efb31face8de | |
parent | 48b40a53b0746848d5c8ea881d319e6120c76d40 (diff) |
_get_conf(): Type-check more configuration values
-rw-r--r-- | locale/en_US.sh | 3 | ||||
-rw-r--r-- | src/main.sh | 9 |
2 files changed, 11 insertions, 1 deletions
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 } |