diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-02-12 16:48:50 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-02-12 16:48:50 +0100 |
commit | dbf5d2834a4e912a9787201313219a817b5c26a4 (patch) | |
tree | 8de977a5d8fc8995f1d7e5c2757c9eb3904ecf37 /ImmaeEu-up | |
parent | e9be45fa1cc955ff8a0e497f8fd3ed7521d0b5a1 (diff) | |
download | hosts-dbf5d2834a4e912a9787201313219a817b5c26a4.tar.gz hosts-dbf5d2834a4e912a9787201313219a817b5c26a4.tar.zst hosts-dbf5d2834a4e912a9787201313219a817b5c26a4.zip |
Adjust scripts to remove the need of tinc_domaine
Diffstat (limited to 'ImmaeEu-up')
-rwxr-xr-x | ImmaeEu-up | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -8,17 +8,17 @@ | |||
8 | # Give it the right ip and netmask. Remember, the subnet of the | 8 | # Give it the right ip and netmask. Remember, the subnet of the |
9 | # tap device must be larger than that of the individual Subnets | 9 | # tap device must be larger than that of the individual Subnets |
10 | # as defined in the host configuration file! | 10 | # as defined in the host configuration file! |
11 | SUBDOMAIN=`cat /etc/tinc/$NETNAME/tinc_domaine` | 11 | 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; }') |
12 | while [ -z "$MYIPS" -o -z "$GWIP" ]; do | 12 | while [ -z "$MYIPS" -o -z "$GWIP" ]; do |
13 | MYIPS=`getent hosts ${SUBDOMAIN}.immae.eu | cut -d' ' -f1 | tr "\\n" ' '` | 13 | MYIPS=`getent hosts ${SUBDOMAIN}.immae.eu | cut -d' ' -f1 | tr "\\n" ' '` |
14 | GWIP=`getent hosts gw.vpn.immae.eu | head -n1 | cut -d' ' -f1` | 14 | GWIP=`getent hosts gw.vpn.immae.eu | head -n1 | cut -d' ' -f1` |
15 | sleep 5 | 15 | sleep 5 |
16 | done | 16 | done |
17 | rm -f /tmp/tinc_$NETNAME | 17 | rm -f /run/tinc_$NETNAME.vars |
18 | echo -e "MYIPS=\"$MYIPS\"\nGWIP=\"$GWIP\"" > /tmp/tinc_$NETNAME | 18 | echo -e "MYIPS=\"$MYIPS\"\nGWIP=\"$GWIP\"" > /run/tinc_$NETNAME.vars |
19 | ip -6 link set $INTERFACE up mtu 1280 | 19 | ip -6 link set $INTERFACE up mtu 1280 |
20 | for MYIP in $MYIPS; do | 20 | for MYIP in $MYIPS; do |
21 | ip -6 addr add $MYIP/96 dev $INTERFACE | 21 | ip -6 addr add $MYIP/96 dev $INTERFACE |
22 | done | 22 | done |
23 | ip -6 route add default via $GWIP | 23 | ip -6 route add default via $GWIP |
24 | (cd /etc/tinc/$NETNAME/hosts && git pull -q origin master) || true | 24 | (cd /etc/tinc/$NETNAME/hosts && git pull -q origin master) || true |