Adjust boolean comparison to allow "false", "no", and "0" to all become "false"

This commit is contained in:
Tianon Gravi 2017-12-20 07:04:54 -08:00
parent 076b6e4866
commit c282d486e6
3 changed files with 12 additions and 3 deletions

View File

@ -245,7 +245,10 @@ rabbit_env_config() {
local rawVal="$val"
case "$conf" in
fail_if_no_peer_cert|hipe_compile)
[ -n "$val" ] && rawVal='true' || rawVal='false'
case "${val,,}" in
false|no|0|'') rawVal='false' ;;
true|yes|1|*) rawVal='true' ;;
esac
;;
vm_memory_high_watermark) continue ;; # handled separately

View File

@ -245,7 +245,10 @@ rabbit_env_config() {
local rawVal="$val"
case "$conf" in
fail_if_no_peer_cert|hipe_compile)
[ -n "$val" ] && rawVal='true' || rawVal='false'
case "${val,,}" in
false|no|0|'') rawVal='false' ;;
true|yes|1|*) rawVal='true' ;;
esac
;;
vm_memory_high_watermark) continue ;; # handled separately

View File

@ -245,7 +245,10 @@ rabbit_env_config() {
local rawVal="$val"
case "$conf" in
fail_if_no_peer_cert|hipe_compile)
[ -n "$val" ] && rawVal='true' || rawVal='false'
case "${val,,}" in
false|no|0|'') rawVal='false' ;;
true|yes|1|*) rawVal='true' ;;
esac
;;
vm_memory_high_watermark) continue ;; # handled separately