From ed67197e7bf74d9498c731600ad9a5b56843d271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jake=20Buchholz=20G=C3=B6kt=C3=BCrk?= Date: Thu, 23 Mar 2023 19:14:43 +0000 Subject: [PATCH] restore "source /lib/tiny-cloud/common" in imds-net-sync --- sbin/imds-net-sync | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sbin/imds-net-sync b/sbin/imds-net-sync index 897a779..4004134 100755 --- a/sbin/imds-net-sync +++ b/sbin/imds-net-sync @@ -6,7 +6,7 @@ [ -z "$VERBOSE" ] || set -x : "${LIBDIR:=$PREFIX/lib}" -"$LIBDIR"/tiny-cloud/common +. "$LIBDIR"/tiny-cloud/common [ -z "${IFACE}" ] && log -s crit "IFACE not set, aborting" @@ -90,7 +90,7 @@ imds_ip6s() { sleep 0.5 done ip -6 route add default via "$gw" dev "$IFACE" table "$RTABLE" - # TODO? match ipds_ip4s() with ip -6 route add "ip6_cidr" dev "$IFACE" ... + # TODO? match imds_ip4s() with ip -6 route add "ip6_cidr" dev "$IFACE" ... fi echo "$ip6s" } @@ -105,10 +105,10 @@ ip_addr() { [ "$1" -eq 6 ] && mask=128 # IPv6 always /128 ip -"$1" addr "$2" "$3/$mask" dev "$IFACE" - # TODO: only non eth0? delegated ipv[46] prefixes? - [ "$IFACE" = eth0 ] && return + # TODO? delegated ipv[46] prefixes? # non-eth0 interfaces get rules associating IPs with route tables + [ "$IFACE" = eth0 ] && return ip -"$1" rule "$2" from "$3" lookup "$RTABLE" ip -"$1" rule "$2" to "$3" lookup "$RTABLE" } @@ -121,6 +121,7 @@ sync_ips() { in_list "$i" "$2" || ip_addr "$1" del "$i" done # add missing IPs + # NOTE: this adds an extra /32 for the primary IP for i in $2; do in_list "$i" "$3" || ip_addr "$1" add "$i" done