update
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
action="${1:-}"
|
action="${1:-}"
|
||||||
FOLDER='/opt/idssys/ta-proxmenu'
|
FOLDER='/opt/idssys/ta-proxmenu'
|
||||||
VERS='2026.7.25-37'
|
VERS='2026.7.25-38'
|
||||||
|
|
||||||
noupdate=' '
|
noupdate=' '
|
||||||
|
|
||||||
|
|||||||
+38
-11
@@ -49,20 +49,47 @@ TAPM_ISO_NFS_SELECT_STORAGE() {
|
|||||||
local variable="$1"
|
local variable="$1"
|
||||||
local label="$2"
|
local label="$2"
|
||||||
local default_value="$3"
|
local default_value="$3"
|
||||||
local value
|
local storage type status index
|
||||||
|
local default_found=0
|
||||||
|
local -a storage_ids=()
|
||||||
|
local -a storage_types=()
|
||||||
|
local -a labels=()
|
||||||
|
local -a values=()
|
||||||
|
|
||||||
echo
|
while read -r storage type status _; do
|
||||||
echo " Active storages that support LXC volumes:"
|
[[ "$storage" != 'Name' && "$status" == 'active' ]] || continue
|
||||||
pvesm status --content rootdir 2>/dev/null |
|
storage_ids+=("$storage")
|
||||||
awk 'NR == 1 || $3 == "active" { printf " %s\n", $1 }'
|
storage_types+=("$type")
|
||||||
TAPM_ISO_NFS_PROMPT value "$label" "$default_value"
|
[[ "$storage" == "$default_value" ]] && default_found=1
|
||||||
if ! pvesm status --content rootdir 2>/dev/null |
|
done < <(pvesm status --content rootdir --enabled 1 2>/dev/null)
|
||||||
awk 'NR > 1 && $3 == "active" { print $1 }' |
|
|
||||||
grep -Fxq -- "$value"; then
|
if (( ${#storage_ids[@]} == 0 )); then
|
||||||
TAPM_ISO_NFS_FAIL "Storage '${value}' is not active here or does not support LXC volumes."
|
TAPM_ISO_NFS_FAIL "No active, enabled storage supports LXC volumes."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
printf -v "$variable" '%s' "$value"
|
|
||||||
|
# Put the suggested storage first so pressing ENTER retains the default.
|
||||||
|
if (( default_found == 1 )); then
|
||||||
|
for index in "${!storage_ids[@]}"; do
|
||||||
|
[[ "${storage_ids[$index]}" == "$default_value" ]] || continue
|
||||||
|
labels+=("${storage_ids[$index]} (${storage_types[$index]}) — default")
|
||||||
|
values+=("storage:${storage_ids[$index]}")
|
||||||
|
break
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
for index in "${!storage_ids[@]}"; do
|
||||||
|
[[ $default_found == 1 && "${storage_ids[$index]}" == "$default_value" ]] &&
|
||||||
|
continue
|
||||||
|
labels+=("${storage_ids[$index]} (${storage_types[$index]})")
|
||||||
|
values+=("storage:${storage_ids[$index]}")
|
||||||
|
done
|
||||||
|
|
||||||
|
SELECT_MENU "$label" labels values
|
||||||
|
case "$MENU_SELECTION" in
|
||||||
|
storage:*) printf -v "$variable" '%s' "${MENU_SELECTION#storage:}";;
|
||||||
|
quit) EXIT1; exit 0;;
|
||||||
|
*) return 1;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
TAPM_DEPLOY_ISO_NFS_LXC() {
|
TAPM_DEPLOY_ISO_NFS_LXC() {
|
||||||
|
|||||||
Reference in New Issue
Block a user