]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/packages/wsdd
wsdd: Append --interface switches to the arguments array
[people/pmueller/ipfire-2.x.git] / 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)