Skip to content
Snippets Groups Projects
Commit ba45ee8f authored by root's avatar root
Browse files

Using multiple DNS-Server to get Segment of Node.

parent 17d809f2
No related branches found
No related tags found
No related merge requests found
...@@ -25,16 +25,24 @@ PUBKEY=$(/etc/init.d/fastd show_key mesh_vpn | cut -c1-12) ...@@ -25,16 +25,24 @@ PUBKEY=$(/etc/init.d/fastd show_key mesh_vpn | cut -c1-12)
DNSDOM="freifunk-stuttgart.de" DNSDOM="freifunk-stuttgart.de"
DNSREQ="ffs-${NODEID}-${PUBKEY}.segassign.${DNSDOM}" DNSREQ="ffs-${NODEID}-${PUBKEY}.segassign.${DNSDOM}"
DNSLIST="::1#54 $(ip r | grep 'default' | cut -d' ' -f3) 9.9.9.9 1.1.1.1 8.8.8.8"
logger -t $ME "DNSv6 on ${DNSREQ} ..." for DNSSRV in $DNSLIST;
GITSEG=$(nslookup ${DNSREQ} ::1#54 | grep "2001:2:0:711::" | cut -d':' -f7) do
if [ -z "$GITSEG" ]; then logger -t $ME "DNSv6 on ${DNSSRV} for ${DNSREQ} ..."
logger -t $ME "DNSv4 on ${DNSREQ} ..." GITSEG=$(nslookup ${DNSREQ} ${DNSSRV} | grep "2001:2:0:711::" | cut -d':' -f7)
GITSEG=$(nslookup ${DNSREQ} ::1#54 | grep "198.18.190." | cut -d'.' -f4) if [ -z "$GITSEG" ]; then
fi logger -t $ME "DNSv4 on ${DNSSRV} for ${DNSREQ} ..."
GITSEG=$(nslookup ${DNSREQ} ${DNSSRV} | grep "198.18.190." | cut -d'.' -f4)
fi
if [ -n "$GITSEG" ]; then
break
fi
done
if [ -z "$GITSEG" ]; then if [ -z "$GITSEG" ]; then
logger -t $ME "DNS not working!" logger -t $ME "DNS not working!"
/etc/init.d/dnsmasq restart
exit 1 exit 1
else else
if [ -n "$BATSEG" ] && [ "$BATSEG" != "$GITSEG" ]; then if [ -n "$BATSEG" ] && [ "$BATSEG" != "$GITSEG" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment