|
|
@ -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 |
|
|
|