Browse Source

Merge pull request #7110 from Andy2244/samba4-fix-netbiosname

samba4: fix netbios_name
lilik-openwrt-22.03
Dirk Brenken 6 years ago
committed by GitHub
parent
commit
f334bc7181
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 20 deletions
  1. +1
    -1
      net/samba4/Makefile
  2. +0
    -1
      net/samba4/files/samba.config
  3. +11
    -18
      net/samba4/files/samba.init

+ 1
- 1
net/samba4/Makefile View File

@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=samba
PKG_VERSION:=4.9.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
PKG_LICENSE:=GPL-3.0-only


+ 0
- 1
net/samba4/files/samba.config View File

@ -1,5 +1,4 @@
config samba
option 'name' 'OpenWrt-SMB'
option 'workgroup' 'WORKGROUP'
option 'description' 'Samba on OpenWrt'
option 'charset' 'UTF-8'


+ 11
- 18
net/samba4/files/samba.init View File

@ -1,6 +1,6 @@
#!/bin/sh /etc/rc.common
START=99
START=98
USE_PROCD=1
smb_header() {
@ -19,12 +19,12 @@ smb_header() {
done
)
local name workgroup description charset
local hostname="$(uci_get system.@system[0].hostname)"
local workgroup description charset
# we dont use netbios anymore as default and wsd/avahi is dns based
local hostname="$(hostname -f)"
config_get name $1 name "${hostname:-OpenWrt}"
config_get workgroup $1 workgroup "${hostname:-WORKGROUP}"
config_get description $1 description "Samba on ${hostname:-OpenWrt}"
config_get workgroup $1 workgroup "WORKGROUP"
config_get description $1 description "Samba on OpenWrt"
config_get charset $1 charset "UTF-8"
config_get_bool MACOS $1 macos 0
@ -33,7 +33,7 @@ smb_header() {
config_get_bool DISABLE_WINBIND $1 disable_winbind 0
mkdir -p /var/etc
sed -e "s#|NAME|#$name#g" \
sed -e "s#|NAME|#$hostname#g" \
-e "s#|WORKGROUP|#$workgroup#g" \
-e "s#|DESCRIPTION|#$description#g" \
-e "s#|INTERFACES|#$interfaces#g" \
@ -144,18 +144,11 @@ init_config() {
config_foreach smb_add_share sambashare
}
reload_service() {
init_config
killall -HUP samba
killall -HUP smbd
killall -HUP nmbd
killall -HUP winbindd
}
service_triggers() {
procd_add_reload_trigger samba4
PROCD_RELOAD_DELAY=2000
procd_add_reload_trigger "dhcp" "system" "samba4"
local i
for i in $samba_iface; do
procd_add_reload_interface_trigger $i


Loading…
Cancel
Save