]> git.immae.eu Git - perso/Immae/Config/tinc/hosts.git/blame - ImmaeEu-up
Merge branch 'master' into android
[perso/Immae/Config/tinc/hosts.git] / ImmaeEu-up
CommitLineData
bbe3d612 1#!/system/xbin/sh
5618bf79 2
bbe3d612
IB
3SUBDOMAIN=$(cat /sdcard/.tinc/tinc_domaine | tr -c -d "[a-zA-Z0-9.]")
4
5MYIPS=$(nslookup $SUBDOMAIN.immae.eu |sed -n "/$SUBDOMAIN.immae.eu/"',$p' | grep ^Address | sed -e "s/^[^:]*:[^0-9]*//" | tr '\n' ' ')
6GWIP=$(nslookup vpn.immae.eu |sed -n "/vpn.immae.eu/"',$p' | grep ^Address | head -n1 | sed -e "s/^[^:]*:[^0-9]*//" | tr '\n' ' ')
7
8echo -e "MYIPS=\"$MYIPS\"\nGWIP=\"$GWIP\"" > /sdcard/.tinc/vars
9ip -6 link set vpn6 up mtu 1280
5618bf79 10for MYIP in $MYIPS; do
bbe3d612 11 ip -6 addr add $MYIP/96 dev vpn6
5618bf79
IB
12done
13ip -6 route add default via $GWIP