X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2Ftinc%2Fhosts.git;a=blobdiff_plain;f=ImmaeEu-up;h=3a2e073179587e9363cdb2b9fdcd7bbfd3e8ed2c;hp=c2dc93adca69af7d45e5089e9a632361a802e0e4;hb=HEAD;hpb=dbf5d2834a4e912a9787201313219a817b5c26a4 diff --git a/ImmaeEu-up b/ImmaeEu-up index c2dc93a..006b86f 100755 --- a/ImmaeEu-up +++ b/ImmaeEu-up @@ -8,6 +8,7 @@ # Give it the right ip and netmask. Remember, the subnet of the # tap device must be larger than that of the individual Subnets # as defined in the host configuration file! +SCRIPT_DIR=$(dirname -- "$( readlink -f -- "$0"; )") SUBDOMAIN=$(echo "$NAME" | sed -e "s/\([A-Z][a-z0-9]*\)/\L\1 /g;" | awk '{ for (i=NF; i>1; i--) printf("%s.",$i); print $1; }') while [ -z "$MYIPS" -o -z "$GWIP" ]; do MYIPS=`getent hosts ${SUBDOMAIN}.immae.eu | cut -d' ' -f1 | tr "\\n" ' '` @@ -19,6 +20,8 @@ echo -e "MYIPS=\"$MYIPS\"\nGWIP=\"$GWIP\"" > /run/tinc_$NETNAME.vars ip -6 link set $INTERFACE up mtu 1280 for MYIP in $MYIPS; do ip -6 addr add $MYIP/96 dev $INTERFACE + ip -6 rule add from $MYIP/96 table 655 + ip -6 rule add to $MYIP/96 table 655 done -ip -6 route add default via $GWIP -(cd /etc/tinc/$NETNAME/hosts && git pull -q origin master) || true +ip -6 route add default via $GWIP dev $INTERFACE table 655 +(cd "$SCRIPT_DIR" && git pull -q origin master) || true