mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-19 19:30:16 +00:00
Called valid_domain function in SetCustomDomain()
This commit is contained in:
parent
0cd9e0deb6
commit
9808234792
1 changed files with 11 additions and 7 deletions
|
@ -722,16 +722,20 @@ setCustomDomain() {
|
||||||
|
|
||||||
until [[ $DomainSettingsCorrect = True ]]
|
until [[ $DomainSettingsCorrect = True ]]
|
||||||
do
|
do
|
||||||
if CUSTOMDomain=$(whiptail --inputbox "Enter Custom Domain\nFormat: mydomain.com" 8 78 --title "Test" 3>&1 1>&2 2>&3); then
|
if CUSTOMDomain=$(whiptail --inputbox "Enter Custom Domain\nFormat: mydomain.com" 8 78 --title "Custom Domain" 3>&1 1>&2 2>&3); then
|
||||||
|
if valid_domain "$CUSTOMDomain"; then
|
||||||
|
if (whiptail --backtitle "Custom Search Domain" --title "Custom Search Domain" --yesno "Are these settings correct?\n Custom Search Domain: $CUSTOMDomain" 8 78); then
|
||||||
|
DomainSettingsCorrect=True
|
||||||
|
|
||||||
if (whiptail --backtitle "Custom Search Domain" --title "Custom Search Domain" --yesno "Are these settings correct?\n Custom Search Domain: $CUSTOMDomain" 8 78); then
|
$SUDO sed -i '0,/\(.*dhcp-option.*\)/s//\push "dhcp-option DOMAIN '${CUSTOMDomain}'" /' server.conf
|
||||||
DomainSettingsCorrect=True
|
|
||||||
|
|
||||||
$SUDO sed -i '0,/\(.*dhcp-option.*\)/s//\push "dhcp-option DOMAIN '${CUSTOMDomain}'" /' /etc/openvpn/server.conf
|
|
||||||
|
|
||||||
|
else
|
||||||
|
# If the settings are wrong, the loop continues
|
||||||
|
DomainSettingsCorrect=False
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# If the settings are wrong, the loop continues
|
whiptail --msgbox --backtitle "Invalid Domain" --title "Invalid Domain" "Domain is invalid. Please try again.\n\n DOMAIN: $CUSTOMDomain\n" 8 78
|
||||||
DomainSettingsCorrect=False
|
DomainSettingsCorrect=False
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "::: Cancel selected. Exiting..."
|
echo "::: Cancel selected. Exiting..."
|
||||||
|
|
Loading…
Reference in a new issue