summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-09 17:22:36 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-09 17:22:36 +0200
commite08f516074d78ae5e51bd72f694fe9c7843aa69e (patch)
tree200b4e01730c349c0fa56e24d2dc02c2d1f02e55
parentaac8e69553cfc73f53b03f6c15efedcf8db9be24 (diff)
downloadhosts-e08f516074d78ae5e51bd72f694fe9c7843aa69e.tar.gz
hosts-e08f516074d78ae5e51bd72f694fe9c7843aa69e.tar.zst
hosts-e08f516074d78ae5e51bd72f694fe9c7843aa69e.zip
Use script dir instead of hardcoded path
-rwxr-xr-xImmaeEu-up3
1 files changed, 2 insertions, 1 deletions
diff --git a/ImmaeEu-up b/ImmaeEu-up
index e9a4c9f..006b86f 100755
--- a/ImmaeEu-up
+++ b/ImmaeEu-up
@@ -8,6 +8,7 @@
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!
11SCRIPT_DIR=$(dirname -- "$( readlink -f -- "$0"; )")
11SUBDOMAIN=$(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; }') 12SUBDOMAIN=$(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; }')
12while [ -z "$MYIPS" -o -z "$GWIP" ]; do 13while [ -z "$MYIPS" -o -z "$GWIP" ]; do
13 MYIPS=`getent hosts ${SUBDOMAIN}.immae.eu | cut -d' ' -f1 | tr "\\n" ' '` 14 MYIPS=`getent hosts ${SUBDOMAIN}.immae.eu | cut -d' ' -f1 | tr "\\n" ' '`
@@ -23,4 +24,4 @@ for MYIP in $MYIPS; do
23 ip -6 rule add to $MYIP/96 table 655 24 ip -6 rule add to $MYIP/96 table 655
24done 25done
25ip -6 route add default via $GWIP dev $INTERFACE table 655 26ip -6 route add default via $GWIP dev $INTERFACE table 655
26(cd /etc/tinc/$NETNAME/hosts && git pull -q origin master) || true 27(cd "$SCRIPT_DIR" && git pull -q origin master) || true