wsdd2: fix infinite loop when BI_PARM is never set
authorSyrone Wong <wong.syrone@gmail.com>
Tue, 5 May 2020 23:49:04 +0000 (07:49 +0800)
committerSyrone Wong <wong.syrone@gmail.com>
Tue, 5 May 2020 23:59:52 +0000 (07:59 +0800)
If BI_PARM is never set, it's "" and causes
infinite loop (before my PR sent upstream) or
error out (after my PR sent upstream).
Append -b option only if it's valid.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
net/wsdd2/files/wsdd2.init

index ee60eee2d80bd49d26b986ea1ed241fe97ff979e..ff7134d4f8a4ddb817c93cbc8b4f4d8b17def13f 100644 (file)
@@ -68,7 +68,7 @@ start_service() {
        [ -n "$ifname" ] && procd_append_param command -i "$ifname"
        procd_append_param command -N "$NB_PARM"
        procd_append_param command -G "$WG_PARM"
-       procd_append_param command -b "$BI_PARM"
+       [ "x${BI_PARM}" != "x" ] && procd_append_param command -b "$BI_PARM"
        procd_set_param respawn
        procd_set_param file "$SMB_CONF"
        procd_close_instance