v0.2.2 Minor change to validate_hostname function

This commit is contained in:
Ze'ev Schurmann 2024-08-02 02:12:36 +02:00
parent 12c3e8777c
commit 8f514d7b99
2 changed files with 4 additions and 3 deletions

5
achar
View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
## Title : ACHAR - Auto Completion of Hosts Add/Remove script ## Title : ACHAR - Auto Completion of Hosts Add/Remove script
## Version : 0.2.1 ## Version : 0.2.2
## GIT Repo : https://git.zaks.web.za/zaks-web/achar ## GIT Repo : https://git.zaks.web.za/zaks-web/achar
## Author : Ze'ev Schurmann ## Author : Ze'ev Schurmann
## Company : ZAKS Web ## Company : ZAKS Web
@ -525,7 +525,7 @@ function validate_host {
else else
echo "Hostname is not an valid!" echo "Invalid Domain Name or IP address!"
exit 1 exit 1
fi fi
@ -533,6 +533,7 @@ function validate_host {
if [[ ${username:0:1} =~ ^[0-9]$ ]] || [[ ! $username =~ ^[A-Za-z0-9_.-]+$ ]]; then if [[ ${username:0:1} =~ ^[0-9]$ ]] || [[ ! $username =~ ^[A-Za-z0-9_.-]+$ ]]; then
echo "Username is not a valid format!" echo "Username is not a valid format!"
echo "Must contain \"A-Z\", \"a-z\", \"0-9\", \"_\", \".\" and \"-\"."
exit 1 exit 1
fi fi

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
## Title : ACHAR - Auto Completion of Hosts Add/Remove script ## Title : ACHAR - Auto Completion of Hosts Add/Remove script
## Version : 0.2.1 ## Version : 0.2.2
## GIT Repo : https://git.zaks.web.za/zaks-web/achar ## GIT Repo : https://git.zaks.web.za/zaks-web/achar
## Author : Ze'ev Schurmann ## Author : Ze'ev Schurmann
## Company : ZAKS Web ## Company : ZAKS Web