Skip to content
Snippets Groups Projects
Verified Commit ae0e46a3 authored by Nico's avatar Nico
Browse files

ffs-set-segment adjustments for experimental firmware

parent ba3ee7b1
No related branches found
No related tags found
No related merge requests found
......@@ -25,38 +25,19 @@ PUBKEY=$(/etc/init.d/fastd show_key mesh_vpn | cut -c1-12)
DNSDOM="freifunk-stuttgart.de"
DNSREQ="ffs-${NODEID}-${PUBKEY}.segassign.${DNSDOM}"
DNSLIST="::1 $(cat /var/gluon/wan-dnsmasq/resolv.conf | cut -d ' ' -f2)"
for ip in $DNSLIST;
do
if [ "$(echo ${ip} | cut -d':' -f1)" = "fe80" ]; then
DNSSRV=${ip}%br-wan
else
DNSSRV=${ip}
fi
logger -t $ME "DNSv6 on ${DNSSRV} for ${DNSREQ} ..."
GITSEG=$(nslookup ${DNSREQ} ${DNSSRV} | grep "2001:2:0:711::" | cut -d':' -f7)
logger -t $ME "DNSv6 for ${DNSREQ} ..."
GITSEG=$(gluon-wan nslookup ${DNSREQ} | grep "2001:2:0:711::" | cut -d':' -f7)
if [ -z "$GITSEG" ]; then
logger -t $ME "DNSv4 on ${DNSSRV} for ${DNSREQ} ..."
GITSEG=$(nslookup ${DNSREQ} ::1 | grep "198.18.190." | cut -d'.' -f4)
logger -t $ME "DNSv4 for ${DNSREQ} ..."
GITSEG=$(gluon-wan nslookup ${DNSREQ} | grep "198.18.190." | cut -d'.' -f4)
fi
if [ -n "$GITSEG" ]; then
break
fi
done
if [ -z "$GITSEG" ]; then
DNSERR=$(nslookup ${DNSREQ} ::1 2>&1)
logger -t $ME "DNS not working: $DNSERR"
logger -t $ME "DNS settings: $(cat /var/gluon/wan-dnsmasq/resolv.conf)"
exit 1
else
if [ "$DNSSRV" != "::1" ]; then
logger -t $ME "DNSMASQ not working - will be restarted"
/etc/init.d/gluon-wan-dnsmasq stop
/etc/init.d/gluon-wan-dnsmasq start
fi
fi
if [ -n "$BATSEG" ] && [ "$BATSEG" != "$GITSEG" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment