Refactor advanced_settings and add whitelist check
Moved and redefined _is_whitelisted_key as a global function for use in multiple locations. Improved formatting and readability in the advanced_settings wizard, including better handling of container type selection and IPv6 configuration steps.
This commit is contained in:
parent
54faeadf07
commit
76e933b3a4
@ -780,7 +780,13 @@ if ! declare -p VAR_WHITELIST >/dev/null 2>&1; then
|
|||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Note: _is_whitelisted_key() is defined above in default_var_settings section
|
# Global whitelist check function (used by _load_vars_file_to_map and others)
|
||||||
|
_is_whitelisted_key() {
|
||||||
|
local k="$1"
|
||||||
|
local w
|
||||||
|
for w in "${VAR_WHITELIST[@]}"; do [ "$k" = "$w" ] && return 0; done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
_sanitize_value() {
|
_sanitize_value() {
|
||||||
# Disallow Command-Substitution / Shell-Meta
|
# Disallow Command-Substitution / Shell-Meta
|
||||||
@ -1199,7 +1205,10 @@ advanced_settings() {
|
|||||||
1)
|
1)
|
||||||
local default_on="ON"
|
local default_on="ON"
|
||||||
local default_off="OFF"
|
local default_off="OFF"
|
||||||
[[ "$_ct_type" == "0" ]] && { default_on="OFF"; default_off="ON"; }
|
[[ "$_ct_type" == "0" ]] && {
|
||||||
|
default_on="OFF"
|
||||||
|
default_off="ON"
|
||||||
|
}
|
||||||
|
|
||||||
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
if result=$(whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \
|
||||||
--title "CONTAINER TYPE" \
|
--title "CONTAINER TYPE" \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user