diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-02-12 18:21:04 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-02-12 18:21:04 +0100 |
commit | 6d0592b79d91196c9fe35cdf6b6a5407a6a44ea4 (patch) | |
tree | 763733958b8c2c277e500468dabc00e6f8f5cc44 | |
parent | e97c5917f6bd6690282f1df59916ab038e0ad9fd (diff) | |
parent | 88e66de272bf09750d2096752dcd4e5fc344cbc3 (diff) | |
download | hosts-android.tar.gz hosts-android.tar.zst hosts-android.zip |
Merge branch 'master' into androidandroid
-rw-r--r-- | ImmaeEu-down | 2 | ||||
-rw-r--r-- | ImmaeEu-up | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/ImmaeEu-down b/ImmaeEu-down index 8a0ef22..1b6260e 100644 --- a/ImmaeEu-down +++ b/ImmaeEu-down | |||
@@ -9,7 +9,7 @@ ip route del table 100 $REMOTEADDRESS | |||
9 | ip -6 route del table 100 $GWIP dev vpn6 | 9 | ip -6 route del table 100 $GWIP dev vpn6 |
10 | ip -6 route del table 100 ::/1 via $GWIP dev vpn6 | 10 | ip -6 route del table 100 ::/1 via $GWIP dev vpn6 |
11 | for MYIP in $MYIPS; do | 11 | for MYIP in $MYIPS; do |
12 | ip -6 addr del $MYIP/96 dev vpn6 | 12 | ip -6 addr del $MYIP/96 dev vpn6 |
13 | done | 13 | done |
14 | ip -6 link set vpn6 down | 14 | ip -6 link set vpn6 down |
15 | 15 | ||
@@ -1,6 +1,7 @@ | |||
1 | #!/system/xbin/sh | 1 | #!/system/xbin/sh |
2 | 2 | ||
3 | SUBDOMAIN=$(cat /sdcard/.tinc/tinc_domaine | tr -c -d "[a-zA-Z0-9.]") | 3 | # Cannot expect awk to be present |
4 | SUBDOMAIN=$(echo "$NAME" | sed -e "s/\([A-Z][a-z0-9]*\)\([A-Z][a-z0-9]*\)/\L\2.\L\1/;") | ||
4 | 5 | ||
5 | MYIPS=$(nslookup $SUBDOMAIN.immae.eu |sed -n "/$SUBDOMAIN.immae.eu/"',$p' | grep ^Address | sed -e "s/^[^:]*:[^0-9]*//" | tr '\n' ' ') | 6 | MYIPS=$(nslookup $SUBDOMAIN.immae.eu |sed -n "/$SUBDOMAIN.immae.eu/"',$p' | grep ^Address | sed -e "s/^[^:]*:[^0-9]*//" | tr '\n' ' ') |
6 | GWIP=$(nslookup gw.vpn.immae.eu |sed -n "/gw.vpn.immae.eu/"',$p' | grep ^Address | head -n1 | sed -e "s/^[^:]*:[^0-9]*//" | tr '\n' ' ') | 7 | 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 | |||
8 | echo -e "MYIPS=\"$MYIPS\"\nGWIP=\"$GWIP\"" > /sdcard/.tinc/vars | 9 | echo -e "MYIPS=\"$MYIPS\"\nGWIP=\"$GWIP\"" > /sdcard/.tinc/vars |
9 | ip -6 link set vpn6 up mtu 1280 | 10 | ip -6 link set vpn6 up mtu 1280 |
10 | for MYIP in $MYIPS; do | 11 | for MYIP in $MYIPS; do |
11 | ip -6 addr add $MYIP/96 dev vpn6 | 12 | ip -6 addr add $MYIP/96 dev vpn6 |
12 | done | 13 | done |
13 | 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) | 14 | 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) |
14 | 15 | ||