From 5618bf796685355b38edade948221e713f0f99f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 13 Jun 2015 22:25:37 +0200 Subject: Commit initial --- ImmaeEu-up | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 ImmaeEu-up (limited to 'ImmaeEu-up') diff --git a/ImmaeEu-up b/ImmaeEu-up new file mode 100755 index 0000000..00eb60f --- /dev/null +++ b/ImmaeEu-up @@ -0,0 +1,23 @@ +#!/bin/sh +# This file sets up the tap device. +# It gives you the freedom to do anything you want with it. +# Use the correct name for the tap device: +# The environment variable $INTERFACE is set to the right name +# on most platforms, but if it doesn't work try to set it manually. + +# 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! +SUBDOMAIN=`cat /etc/tinc/$NETNAME/tinc_domaine` +while [ -z "$MYIPS" -o -z "$GWIP" ]; do + MYIPS=`getent hosts ${SUBDOMAIN}.immae.eu | cut -d' ' -f1 | tr "\\n" ' '` + GWIP=`getent hosts vpn.immae.eu | head -n1 | cut -d' ' -f1` + sleep 5 +done +rm -f /tmp/tinc_$NETNAME +echo -e "MYIPS=\"$MYIPS\"\nGWIP=\"$GWIP\"" > /tmp/tinc_$NETNAME +ip -6 link set $INTERFACE up mtu 1280 +for MYIP in $MYIPS; do + ip -6 addr add $MYIP/96 dev $INTERFACE +done +ip -6 route add default via $GWIP -- cgit v1.2.3