]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
wsdd: Append --interface switches to the arguments array
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 11 Jan 2024 15:14:11 +0000 (16:14 +0100)
committerDaniel Weismüller <daniel.weismueller@ipfire.org>
Thu, 11 Jan 2024 15:14:11 +0000 (16:14 +0100)
Signed-off-by: Daniel Weismüller <daniel.weismueller@ipfire.org>
src/initscripts/packages/wsdd

index e4ae3d2989dbbb0a33c2184d451e0e30e2e13f1c..22af031695a9917a2d372f58296c740edfa4773a 100644 (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)