update
This commit is contained in:
@@ -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" ||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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}}"
|
||||
}
|
||||
Reference in New Issue
Block a user