mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Added function valid_domain to check user input of custom domain
This commit is contained in:
parent
3a0d6b1b47
commit
0cd9e0deb6
1 changed files with 12 additions and 0 deletions
|
@ -380,6 +380,18 @@ function valid_ip()
|
||||||
return $stat
|
return $stat
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#Call this function to use a regex to check user input for a valid custom domain
|
||||||
|
function valid_domain()
|
||||||
|
{
|
||||||
|
local domain=$1
|
||||||
|
local stat=1
|
||||||
|
|
||||||
|
if [[ $domain =~ ^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}\.[a-zA-Z]{2,}$ ]]; then
|
||||||
|
stat=$?
|
||||||
|
fi
|
||||||
|
return $stat
|
||||||
|
}
|
||||||
|
|
||||||
installScripts() {
|
installScripts() {
|
||||||
# Install the scripts from /etc/.pivpn to their various locations
|
# Install the scripts from /etc/.pivpn to their various locations
|
||||||
$SUDO echo ":::"
|
$SUDO echo ":::"
|
||||||
|
|
Loading…
Reference in a new issue