]> git.immae.eu Git - perso/Immae/Config/tinc/hosts.git/commitdiff
Merge branch 'master' into android android
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 12 Feb 2020 17:21:04 +0000 (18:21 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 12 Feb 2020 17:21:04 +0000 (18:21 +0100)
ImmaeEu-down
ImmaeEu-up

index 8a0ef220f5d7d18a2f7ba7fec933dc05f238d08b..1b6260e21b800c00813dabaa078701c89a63c57a 100644 (file)
@@ -9,7 +9,7 @@ ip route del table 100 $REMOTEADDRESS
 ip -6 route del table 100 $GWIP dev vpn6
 ip -6 route del table 100 ::/1 via $GWIP dev vpn6
 for MYIP in $MYIPS; do
-       ip -6 addr del $MYIP/96 dev vpn6
+  ip -6 addr del $MYIP/96 dev vpn6
 done
 ip -6 link set vpn6 down
 
index 09210464827a5440419242c13f54bac921fc7eba..b24eed86a5c01d2a2d6d8c699d48c05ead8d7f60 100644 (file)
@@ -1,6 +1,7 @@
 #!/system/xbin/sh
 
-SUBDOMAIN=$(cat /sdcard/.tinc/tinc_domaine | tr -c -d "[a-zA-Z0-9.]")
+# Cannot expect awk to be present
+SUBDOMAIN=$(echo "$NAME" | sed -e "s/\([A-Z][a-z0-9]*\)\([A-Z][a-z0-9]*\)/\L\2.\L\1/;")
 
 MYIPS=$(nslookup $SUBDOMAIN.immae.eu |sed -n "/$SUBDOMAIN.immae.eu/"',$p' | grep ^Address | sed -e "s/^[^:]*:[^0-9]*//" | tr '\n' ' ')
 GWIP=$(nslookup gw.vpn.immae.eu |sed -n "/gw.vpn.immae.eu/"',$p' | grep ^Address | head -n1 | sed -e "s/^[^:]*:[^0-9]*//" | tr '\n' ' ')
@@ -8,7 +9,7 @@ GWIP=$(nslookup gw.vpn.immae.eu |sed -n "/gw.vpn.immae.eu/"',$p' | grep ^Address
 echo -e "MYIPS=\"$MYIPS\"\nGWIP=\"$GWIP\"" > /sdcard/.tinc/vars
 ip -6 link set vpn6 up mtu 1280
 for MYIP in $MYIPS; do
-       ip -6 addr add $MYIP/96 dev vpn6
+  ip -6 addr add $MYIP/96 dev vpn6
 done
 ORIGINAL_GATEWAY=$(for a in $(ip rule show | grep lookup | sed -r 's/.* lookup ([^ ]+).*/\1/'); do ip route show table $a | grep ^default | cut -d ' ' -f 2-5; done | head -1)