Files
instance-metadata-service/deploy/scripts/setup-link-local-macos.sh
T
2026-05-02 02:30:12 -07:00

16 lines
279 B
Bash
Executable File

#!/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