mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-23 09:22:59 +02:00
wsdd: Compose the ARGS array only when we need it
Signed-off-by: Daniel Weismüller <daniel.weismueller@ipfire.org>
This commit is contained in:
committed by
Daniel Weismüller
parent
749b93c6e9
commit
06c2bfa3c4
@@ -29,29 +29,29 @@ mkdir -p /var/run/wsdd
|
||||
|
||||
PIDFILE="/var/run/wsdd.pid"
|
||||
|
||||
ARGS=(
|
||||
# Launch as non-privileged user
|
||||
"--user" "wsdd:wsdd"
|
||||
|
||||
# Launch in chroot
|
||||
"--chroot" "/var/run/wsdd"
|
||||
|
||||
# Only use IPv4
|
||||
"--ipv4only"
|
||||
|
||||
# Configure the workgroup
|
||||
"--workgroup" "$(testparm -s --parameter-name workgroup 2>/dev/null)"
|
||||
)
|
||||
|
||||
# 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)
|
||||
ARGS=(
|
||||
# Launch as non-privileged user
|
||||
"--user" "wsdd:wsdd"
|
||||
|
||||
# Launch in chroot
|
||||
"--chroot" "/var/run/wsdd"
|
||||
|
||||
# Only use IPv4
|
||||
"--ipv4only"
|
||||
|
||||
# Configure the workgroup
|
||||
"--workgroup" "$(testparm -s --parameter-name workgroup 2>/dev/null)"
|
||||
)
|
||||
|
||||
# Conditionally add the GREEN/BLUE interface
|
||||
for intf in GREEN_DEV BLUE_DEV; do
|
||||
if [ -n "${!intf}" ]; then
|
||||
ARGS+=( "--interface" "${!intf}" )
|
||||
fi
|
||||
done
|
||||
|
||||
boot_mesg "Starting wsdd daemon..."
|
||||
loadproc -b -p "${PIDFILE}" /usr/bin/wsdd "${ARGS[@]}"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user