This commit is contained in:
dahyeon committed 2026-05-02 02:30:12 -07:00
commit 08c0e9c107
33 files changed
+4312

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
IFACE="${IMDS_DUMMY_INTERFACE:-imds-dummy}"
ADDR="${IMDS_LINK_LOCAL_ADDRESS:-169.254.169.254/32}"
if ! command -v ip >/dev/null 2>&1; then
echo "ip command is required" >&2
exit 1
fi
if ! ip link show "$IFACE" >/dev/null 2>&1; then
ip link add dev "$IFACE" type dummy
fi
if ! ip addr show dev "$IFACE" | grep -q "169.254.169.254"; then
ip addr add "$ADDR" dev "$IFACE"
fi
ip link set "$IFACE" up
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
ADDR="${IMDS_LINK_LOCAL_ADDRESS:-169.254.169.254}"
if ! command -v ifconfig >/dev/null 2>&1; then
echo "ifconfig command is required" >&2
exit 1
fi
if ifconfig lo0 | grep -q "$ADDR"; then
exit 0
fi
ifconfig lo0 alias "$ADDR/32" up