From 1d2a22397ef1249013f7e6207a5acf495172479a Mon Sep 17 00:00:00 2001 From: climberomes Date: Sun, 21 Dec 2025 00:06:11 -0800 Subject: [PATCH] Specifically assign 0 when not provider passed in --- installers/common.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 0eaf97fa..5c2fbea9 100644 --- a/installers/common.sh +++ b/installers/common.sh @@ -425,12 +425,13 @@ function _prompt_install_feature() { $function fi elif [ "$opt" == "pv_option" ]; then - local opt_value=${!opt} - # Skip silently if not requested (opt_value is 0) + # pv_option has multiple options and is not a normal binary flag [enabled(1)/disabled(0)]. + # We must evaluate the input flag and its value in this block + local opt_value=${!opt:-0} # Default to zero if somehow pv_option is still assigned as to null. if [ "$opt_value" == 0 ]; then - echo "(Skipped)" + echo "(Skipped)" # Skip if VPN Provider not selected / assigned else - # Iterate over the VPN provider options + # Iterate over the defined VPN providers by pulling the valid providers from the config file local valid_ids=($(jq -r '.providers[].id' "$webroot_dir/config/vpn-providers.json")) local found=0 for id in "${valid_ids[@]}"; do @@ -440,14 +441,14 @@ function _prompt_install_feature() { fi done if [ $found == 1 ]; then - echo -e + echo -e # Newline for UI / clean output $function else _install_status 1 "Invalid VPN provider ID $opt_value - (Skipped)" fi fi elif [ "${!opt}" == 1 ]; then - echo -e + echo -e # Newline for UI / clean output $function else echo "(Skipped)"