From e08f516074d78ae5e51bd72f694fe9c7843aa69e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 9 Oct 2023 17:22:36 +0200 Subject: [PATCH] Use script dir instead of hardcoded path --- ImmaeEu-up | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ImmaeEu-up b/ImmaeEu-up index e9a4c9f..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" ' '` @@ -23,4 +24,4 @@ for MYIP in $MYIPS; do ip -6 rule add to $MYIP/96 table 655 done ip -6 route add default via $GWIP dev $INTERFACE table 655 -(cd /etc/tinc/$NETNAME/hosts && git pull -q origin master) || true +(cd "$SCRIPT_DIR" && git pull -q origin master) || true -- 2.41.0