From fc92aee0fefa94bffa4ba1cecdad6c0d3209d0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Numbus?= Date: Fri, 29 May 2026 21:38:05 +0200 Subject: [PATCH] Misc fixes. Updated IPV4 regex. --- script/deploy.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/script/deploy.sh b/script/deploy.sh index d8b4eb5..3483c56 100755 --- a/script/deploy.sh +++ b/script/deploy.sh @@ -97,7 +97,7 @@ launch_gui() { } hierarchy_preparation() { - echod "\n 🔄 Preparing the folder hierarchy for the final configuration..." + echod "\n 🔄 Preparing the folder hierarchy for the final configuration...\n" # Extra files folders mkdir -${MKDIR_FLAGS} ${TMP_EXTRA_PATH}/home/numbus-admin/.ssh/ @@ -112,13 +112,13 @@ hierarchy_preparation() { setup_ssh() { edit_var() { echo -e "${1}" - echo -e " Please check the credentials provided in the configuration." + echo -e " Please check the credentials provided in the configuration." echo -e "\n ➡️ Here are the current settings : - Target IP address : $(gum style --italic "\"${LIVE_TARGET_IP}\"") - Target password : $(gum style --italic "\"${LIVE_TARGET_PASSWORD}\"")" + Target IP address : $(gum style --italic "\"${LIVE_TARGET_IP}\"") + Target password : $(gum style --italic "\"${LIVE_TARGET_PASSWORD}\"")" gum confirm "Are these correct ?" || { - get_valid_input "LIVE_TARGET_IP" "\n ➡️ Provide the IP address of your machine in a NixOS live environment :" "192.168.1.100" "IP_REGEX"; - get_valid_input "LIVE_TARGET_IP" "\n ➡️ Provide the password of your machine in a NixOS live environment :" "password" "" "true" "true"; + get_valid_input "LIVE_TARGET_IP" "➡️ Provide the IP address of your machine in a NixOS live environment :" "192.168.1.100" "IP_REGEX"; + get_valid_input "LIVE_TARGET_IP" "➡️ Provide the password of your machine in a NixOS live environment :" "password" "" "true" "true"; continue; } gum confirm "Retry connection ?" || { @@ -802,7 +802,7 @@ else STDERR="/dev/null" fi -IP_REGEX='^([0-9]{1,3}\.){3}[0-9]{1,3}$' +IP_REGEX='^(((?!25?[6-9])[12]\d|[1-9])?\d\.?\b){4}$' SUBNET_REGEX='^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$' DOMAIN_REGEX='^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$' EMAIL_REGEX='^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'