diff --git a/ic-os/components/misc/config/setupos/config.sh b/ic-os/components/misc/config/setupos/config.sh index b72e869f5de..630b5ab8ff5 100644 --- a/ic-os/components/misc/config/setupos/config.sh +++ b/ic-os/components/misc/config/setupos/config.sh @@ -6,9 +6,17 @@ # Arguments: # $1 - JSON path to the desired value (e.g., '.icos_settings.nns_urls') # Returns: -# If key not found or value is "null", returns empty string. Otherwise, returns value +# If key is not found or value is "null", returns empty string. +# Otherwise, returns value. function get_config_value() { local CONFIG_FILE="/var/ic/config/config.json" local key=$1 - jq -re "${key}" "${CONFIG_FILE}" 2>/dev/null || echo "" + + local value=$(jq -r "${key}" "${CONFIG_FILE}") + + if [[ "${value}" == "null" ]]; then + echo "" + else + echo "${value}" + fi }