This commit is contained in:
David Schroeder
2026-07-25 19:35:17 -05:00
parent f2da5b3062
commit 7102550f4e
12 changed files with 430 additions and 30 deletions
+5 -1
View File
@@ -9,6 +9,10 @@ TAPM_ISO_NFS_VALID_CTID() {
[[ "${1:-}" =~ ^[1-9][0-9]{2,8}$ ]]
}
TAPM_ISO_NFS_VALID_HOSTNAME() {
[[ "${1:-}" =~ ^[A-Za-z0-9][A-Za-z0-9.-]{0,62}$ ]]
}
TAPM_ISO_NFS_VALID_IPV4_CIDR() {
local value="${1:-}"
local address prefix octet
@@ -126,7 +130,7 @@ TAPM_DEPLOY_ISO_NFS_LXC() {
fi
TAPM_ISO_NFS_PROMPT hostname "Container hostname" "PVE-Shared-Storage"
[[ "$hostname" =~ ^[A-Za-z0-9][A-Za-z0-9.-]{0,62}$ ]] ||
TAPM_ISO_NFS_VALID_HOSTNAME "$hostname" ||
{ TAPM_ISO_NFS_FAIL "The hostname is invalid."; return 1; }
TAPM_ISO_NFS_PROMPT address_cidr "Static IPv4 address with prefix (example: 10.20.30.10/24)"
TAPM_ISO_NFS_VALID_IPV4_CIDR "$address_cidr" ||
+1
View File
@@ -345,6 +345,7 @@ remote_exec() {
if [[ "$node" == "$LOCAL_NODE" ]]; then
bash -lc "$cmd"
else
# shellcheck disable=SC2029 # cmd is intentionally expanded into the remote command.
ssh "${SSH_OPTS[@]}" "root@${node}" "$cmd"
fi
}
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Pure VirtIO filename helpers shared by TA-ProxMenu and its tests.
TAPM_VIRTIO_FILENAME_FROM_URL() {
local url="${1%%\?*}"
local filename="${url##*/}"
[[ "$filename" =~ ^virtio-win(-0\.1\.[0-9]+)?\.iso$ ]] || return 1
printf '%s\n' "$filename"
}
TAPM_VIRTIO_LABELED_FILENAME() {
local source_filename="$1"
local label="$2"
local version=''
[[ "$label" =~ ^[a-z0-9-]+$ ]] || return 1
if [[ "$source_filename" =~ ^virtio-win-(0\.1\.[0-9]+)\.iso$ ]]; then
version="${BASH_REMATCH[1]}"
elif [[ "$source_filename" != 'virtio-win.iso' ]]; then
return 1
fi
printf 'virtio-win-%s%s.iso\n' "$label" "${version:+-${version}}"
}