Compare commits

...

2 Commits

Author SHA1 Message Date
CanbiZ
a5257e6734 Merge branch 'main' of https://github.com/community-scripts/ProxmoxVED 2025-06-19 16:33:32 +02:00
CanbiZ
ad4499cfbd check hostname 2025-06-19 16:33:31 +02:00

View File

@ -468,6 +468,14 @@ advanced_settings() {
else
HN=$(echo "${CT_NAME,,}" | tr -d ' ')
fi
# Hostname validate (RFC 1123)
if ! [[ "$HN" =~ ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ ]]; then
whiptail --backtitle "[dev] Proxmox VE Helper Scripts" \
--msgbox "❌ Invalid hostname: '$HN'\n\nOnly lowercase letters, digits and hyphens (-) are allowed.\nUnderscores (_) or other characters are not permitted!" 10 70
advanced_settings
fi
echo -e "${HOSTNAME}${BOLD}${DGN}Hostname: ${BGN}$HN${CL}"
else
exit_script