summaryrefslogtreecommitdiff
path: root/ImmaeEu-up
diff options
context:
space:
mode:
Diffstat (limited to 'ImmaeEu-up')
-rw-r--r--ImmaeEu-up5
1 files changed, 3 insertions, 2 deletions
diff --git a/ImmaeEu-up b/ImmaeEu-up
index 0921046..b24eed8 100644
--- a/ImmaeEu-up
+++ b/ImmaeEu-up
@@ -1,6 +1,7 @@
1#!/system/xbin/sh 1#!/system/xbin/sh
2 2
3SUBDOMAIN=$(cat /sdcard/.tinc/tinc_domaine | tr -c -d "[a-zA-Z0-9.]") 3# Cannot expect awk to be present
4SUBDOMAIN=$(echo "$NAME" | sed -e "s/\([A-Z][a-z0-9]*\)\([A-Z][a-z0-9]*\)/\L\2.\L\1/;")
4 5
5MYIPS=$(nslookup $SUBDOMAIN.immae.eu |sed -n "/$SUBDOMAIN.immae.eu/"',$p' | grep ^Address | sed -e "s/^[^:]*:[^0-9]*//" | tr '\n' ' ') 6MYIPS=$(nslookup $SUBDOMAIN.immae.eu |sed -n "/$SUBDOMAIN.immae.eu/"',$p' | grep ^Address | sed -e "s/^[^:]*:[^0-9]*//" | tr '\n' ' ')
6GWIP=$(nslookup gw.vpn.immae.eu |sed -n "/gw.vpn.immae.eu/"',$p' | grep ^Address | head -n1 | sed -e "s/^[^:]*:[^0-9]*//" | tr '\n' ' ') 7GWIP=$(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
8echo -e "MYIPS=\"$MYIPS\"\nGWIP=\"$GWIP\"" > /sdcard/.tinc/vars 9echo -e "MYIPS=\"$MYIPS\"\nGWIP=\"$GWIP\"" > /sdcard/.tinc/vars
9ip -6 link set vpn6 up mtu 1280 10ip -6 link set vpn6 up mtu 1280
10for MYIP in $MYIPS; do 11for MYIP in $MYIPS; do
11 ip -6 addr add $MYIP/96 dev vpn6 12 ip -6 addr add $MYIP/96 dev vpn6
12done 13done
13ORIGINAL_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) 14ORIGINAL_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)
14 15