Browse Source

wsdd2: Uppercase NB_PARM

* Uppercase NB_PARM if mdns option is not set
* filter commented lines

Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
lilik-openwrt-22.03
Andy Walsh 4 years ago
parent
commit
3ba3a0ba4a
2 changed files with 12 additions and 3 deletions
  1. +1
    -1
      net/wsdd2/Makefile
  2. +11
    -2
      net/wsdd2/files/wsdd2.init

+ 1
- 1
net/wsdd2/Makefile View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=wsdd2 PKG_NAME:=wsdd2
PKG_RELEASE:=8
PKG_RELEASE:=9
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/Andy2244/wsdd2.git PKG_SOURCE_URL:=https://github.com/Andy2244/wsdd2.git


+ 11
- 2
net/wsdd2/files/wsdd2.init View File

@ -29,13 +29,22 @@ start_service() {
logger -p daemon.error -t 'wsdd2' "samba36/4 or ksmbd is not running, can't start wsdd2!" logger -p daemon.error -t 'wsdd2' "samba36/4 or ksmbd is not running, can't start wsdd2!"
exit 1 exit 1
} }
# cleanup comments
local smb_conf
smb_conf="$(grep '^[[:blank:]]*[^[:blank:]#;]' $SMB_CONF)"
local nb_name local nb_name
nb_name="$(grep -i 'netbios name' $SMB_CONF | awk -F'=' '{print $2}' | tr -d ' \n')"
nb_name="$(echo "$smb_conf" | grep -i 'netbios name' | awk -F'=' '{print $2}' | tr -d ' \n')"
[ -n "$nb_name" ] && NB_PARM="$nb_name" [ -n "$nb_name" ] && NB_PARM="$nb_name"
# use uppercase for none mdns option
local nb_option
nb_option="$(echo "$smb_conf" | grep -i 'mdns name' | awk -F'=' '{print $2}' | tr -d ' \n')"
[ "$nb_option" != "mdns" ] && NB_PARM="$(echo "$nb_name" | awk '{print toupper($0)}')"
local wg_name local wg_name
wg_name="$(grep -i 'workgroup' $SMB_CONF | awk -F'=' '{print $2}' | tr -d ' \n')"
wg_name="$(echo "$smb_conf" | grep -i 'workgroup' | awk -F'=' '{print $2}' | tr -d ' \n')"
[ -n "$wg_name" ] && WG_PARM="$wg_name" [ -n "$wg_name" ] && WG_PARM="$wg_name"
# resolve lan interface (BUG: No multi-interface binds atm) # resolve lan interface (BUG: No multi-interface binds atm)


Loading…
Cancel
Save