24 lines
631 B
Shell
Executable file
24 lines
631 B
Shell
Executable file
#!/bin/sh
|
|
# entrypoint.sh — mdns-reflector container entrypoint
|
|
#
|
|
# Expects interface names via env var INTERFACES (space-separated),
|
|
# or falls back to all non-loopback interfaces.
|
|
|
|
set -e
|
|
|
|
if [ -n "$INTERFACES" ]; then
|
|
# shellcheck disable=SC2086
|
|
set -- $INTERFACES
|
|
else
|
|
# Auto-detect: all 'up' interfaces except loopback
|
|
set -- $(ip -o link show up | awk -F': ' '!/lo/{print $2}' | cut -d@ -f1)
|
|
fi
|
|
|
|
if [ $# -eq 0 ]; then
|
|
echo "ERROR: No interfaces found. Set INTERFACES env var or attach interfaces."
|
|
exit 1
|
|
fi
|
|
|
|
echo "[entrypoint] Starting mdns-repeater on: $*"
|
|
exec /usr/local/bin/mdns-repeater "$@"
|
|
|