Browse Source

Merge pull request #12866 from Andy2244/wsdd2-netbios_name-uppercase-fix

wsdd2: Uppercase NB_PARM
lilik-openwrt-22.03
Rosen Penev 4 years ago
committed by GitHub
parent
commit
1c067a8463
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
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
PKG_NAME:=wsdd2
PKG_RELEASE:=8
PKG_RELEASE:=9
PKG_SOURCE_PROTO:=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!"
exit 1
}
# cleanup comments
local smb_conf
smb_conf="$(grep '^[[:blank:]]*[^[:blank:]#;]' $SMB_CONF)"
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"
# 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
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"
# resolve lan interface (BUG: No multi-interface binds atm)


Loading…
Cancel
Save