1
0
mirror of synced 2024-11-25 14:26:09 +03:00

Improve DNS check

This commit is contained in:
hwdsl2 2020-06-12 11:05:42 -05:00
parent 50ac87c7b3
commit 3faa8fd86e
2 changed files with 16 additions and 0 deletions

View File

@ -117,6 +117,14 @@ case "$VPN_IPSEC_PSK $VPN_USER $VPN_PASSWORD" in
;;
esac
if [ -n "$VPN_DNS_SRV1" ] && ! check_ip "$VPN_DNS_SRV1"; then
exiterr "DNS server 'VPN_DNS_SRV1' is invalid."
fi
if [ -n "$VPN_DNS_SRV2" ] && ! check_ip "$VPN_DNS_SRV2"; then
exiterr "DNS server 'VPN_DNS_SRV2' is invalid."
fi
bigecho "VPN setup in progress... Please be patient."
# Create and change to working dir

View File

@ -106,6 +106,14 @@ case "$VPN_IPSEC_PSK $VPN_USER $VPN_PASSWORD" in
;;
esac
if [ -n "$VPN_DNS_SRV1" ] && ! check_ip "$VPN_DNS_SRV1"; then
exiterr "DNS server 'VPN_DNS_SRV1' is invalid."
fi
if [ -n "$VPN_DNS_SRV2" ] && ! check_ip "$VPN_DNS_SRV2"; then
exiterr "DNS server 'VPN_DNS_SRV2' is invalid."
fi
bigecho "VPN setup in progress... Please be patient."
# Create and change to working dir