From d0b1b1c8f9cc70753c467d74d8d7bd828f969af2 Mon Sep 17 00:00:00 2001 From: climberomes Date: Thu, 11 Dec 2025 17:30:24 -0800 Subject: [PATCH] Check vpn provider then execute if valid --- installers/common.sh | 20 ++++++++++++++++++++ installers/raspbian.sh | 1 + 2 files changed, 21 insertions(+) diff --git a/installers/common.sh b/installers/common.sh index c4b8052a..8eaca706 100644 --- a/installers/common.sh +++ b/installers/common.sh @@ -422,9 +422,29 @@ function _prompt_install_feature() { if [ "$answer" != "${answer#[Nn]}" ]; then _install_status 0 "(Skipped)" else + echo -e $function fi + elif [ "$opt" == "pv_option" ]; then + # Iterate over the VPN provider options + valid_ids=($(jq -r '.providers[].id' "$webroot_dir/config/vpn-providers.json")) + # check if pv_option is defined + local value=${!opt} + local found=0 + for id in "${valid_ids[@]}"; do + if [ "$id" == "$value" ]; then + found=1 + break # we found a match + fi + done + if [ $found == 1 ]; then + echo -e + $function + else + _install_status 0 "Invalid VPN provider ID ${!opt} - (Skipped)" + fi elif [ "${!opt}" == 1 ]; then + echo -e $function else echo "(Skipped)" diff --git a/installers/raspbian.sh b/installers/raspbian.sh index fe368670..2b196bbd 100755 --- a/installers/raspbian.sh +++ b/installers/raspbian.sh @@ -106,6 +106,7 @@ function _parse_params() { restapi_option=1 adblock_option=1 wg_option=1 + pv_option=0 insiders=0 ssh=0 minwrite=0