Skip to content
Snippets Groups Projects
Commit 436a859d authored by Roland's avatar Roland
Browse files

DNS Request with NodeID + Fastd-Key, prepared for reply with MTU.

parent 3ed7c021
No related branches found
No related tags found
No related merge requests found
......@@ -16,15 +16,17 @@ fi
NODEID=`uci get network.bat0.macaddr | sed 's/://g'`
PUBKEY=`/etc/init.d/fastd show_key mesh_vpn | cut -c1-12`
SEGMENT=`nslookup ffs-$NODEID-$PUBKEY.segassign.freifunk-stuttgart.de [::1]:54 | tail -n1`
if [[ -z "${SEGMENT// }" ]]; then
SEGINFO=`nslookup ffs-$NODEID-$PUBKEY.segassign.freifunk-stuttgart.de [::1]:54 | tail -n1`
if [ -z "$SEGINFO" ]; then
echo Node not known
exit 1
fi
SEGMENT=${SEGMENT/Address 1: 2001:2:0:711::/}
SEGINFO=${SEGINFO/Address 1: 2001:2:0:711::/}
VPNMTU=$(echo $SEGINFO | cut -d':' -s -f1)
SEGMENT=$(echo $SEGINFO | cut -d':' -f2)
let PORT=SEGMENT+10040
SEGNUM=$(printf "%02d" $SEGMENT)
CHANGED=0
for i in `seq 1 10`;
do
......@@ -39,6 +41,10 @@ do
done
if [ "$CHANGED" = "1" ]; then
if [ -n "$VPNMTU" ]; then
uci set fastd.mesh_vpn.mtu="$VPNMTU"
echo MTU set to $VPNMTU
fi
/etc/init.d/fastd restart
echo Segment set to $SEGNUM
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment