wsdd: Append --interface switches to the arguments array

Signed-off-by: Daniel Weismüller <daniel.weismueller@ipfire.org>
This commit is contained in:
Michael Tremer
2024-01-11 16:14:11 +01:00
committed by Daniel Weismüller
parent 43c2dc9318
commit 749b93c6e9

View File

@@ -43,15 +43,17 @@ ARGS=(
"--workgroup" "$(testparm -s --parameter-name workgroup 2>/dev/null)"
)
INTERFACES="--interface ${GREEN_DEV}"
if [ -n "${BLUE_DEV}" ]; then
INTERFACES="${INTERFACES} --interface ${BLUE_DEV}"
fi
# Conditionally add the GREEN/BLUE interface
for intf in GREEN_DEV BLUE_DEV; do
if [ -n "${!intf}" ]; then
ARGS+=( "--interface" "${!intf}" )
fi
done
case "$1" in
start)
boot_mesg "Starting wsdd daemon..."
loadproc -b -p "${PIDFILE}" /usr/bin/wsdd "${ARGS[@]}" ${INTERFACES}
loadproc -b -p "${PIDFILE}" /usr/bin/wsdd "${ARGS[@]}"
;;
stop)