diff --git a/extras/vpnupgrade.sh b/extras/vpnupgrade.sh index 560a731..45b9504 100644 --- a/extras/vpnupgrade.sh +++ b/extras/vpnupgrade.sh @@ -71,8 +71,8 @@ case "$SWAN_VER" in DNS_SRVS=$(printf '%s' "$DNS_SRVS" | cut -d '"' -f 2 | cut -d "'" -f 2 | sed 's/,/ /g' | tr -s ' ') DNS_SRV1=$(printf '%s' "$DNS_SRVS" | cut -d ' ' -f 1) DNS_SRV2=$(printf '%s' "$DNS_SRVS" | cut -s -d ' ' -f 2) + [ -n "$DNS_SRV1" ] && dns_state=4 [ -n "$DNS_SRV1" ] && [ -n "$DNS_SRV2" ] && dns_state=3 - [ -n "$DNS_SRV1" ] && [ -z "$DNS_SRV2" ] && dns_state=4 [ "$(grep -c "modecfgdns=" /etc/ipsec.conf)" -gt "1" ] && dns_state=6 ;; esac diff --git a/extras/vpnupgrade_centos.sh b/extras/vpnupgrade_centos.sh index 64ed4f3..a3eb542 100644 --- a/extras/vpnupgrade_centos.sh +++ b/extras/vpnupgrade_centos.sh @@ -62,8 +62,8 @@ case "$SWAN_VER" in DNS_SRVS=$(printf '%s' "$DNS_SRVS" | cut -d '"' -f 2 | cut -d "'" -f 2 | sed 's/,/ /g' | tr -s ' ') DNS_SRV1=$(printf '%s' "$DNS_SRVS" | cut -d ' ' -f 1) DNS_SRV2=$(printf '%s' "$DNS_SRVS" | cut -s -d ' ' -f 2) + [ -n "$DNS_SRV1" ] && dns_state=4 [ -n "$DNS_SRV1" ] && [ -n "$DNS_SRV2" ] && dns_state=3 - [ -n "$DNS_SRV1" ] && [ -z "$DNS_SRV2" ] && dns_state=4 [ "$(grep -c "modecfgdns=" /etc/ipsec.conf)" -gt "1" ] && dns_state=6 ;; esac