Skip to content

Commit

Permalink
ffmuc-mesh-vpn-wireguard: fix for older nslookup
Browse files Browse the repository at this point in the history
Older versions of nslookup use a different format
  • Loading branch information
grische committed Apr 6, 2024
1 parent bdbcdf6 commit 0c4b507
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ NTP_SERVERS_ADDRS=""

set -o pipefail # Enable pipefail: this script does not fully support pipefail yet, but required below
for NTP_SERVER in $NTP_SERVERS; do
all_ntp_ips="$(gluon-wan nslookup "$NTP_SERVER" | grep '^Address:\? ' | sed 's/^Address:\? //')"
# older versions of nslookup use "Address 1:" with increasing numbers, newer just use "Address:"
all_ntp_ips="$(gluon-wan nslookup "$NTP_SERVER" | grep '^Address \?[0-9]*:\? ' | sed 's/^Address \?[0-9]*:\? //')"
if ip -6 route show table 1 | grep -q 'default via'
then
# We need to match a few special cases for IPv6 here:
Expand Down

0 comments on commit 0c4b507

Please sign in to comment.