Rebased from upstream / out of band repository.
[librecmc/librecmc.git] / package / network / services / samba36 / files / samba.init
index c8413243bac9806399b1763e1bb4cf6bba46c19d..bb65c0767e1653f2756d8e42b158aeff7f7e6cf9 100755 (executable)
@@ -15,12 +15,7 @@ smb_header() {
                for net in $samba_iface; do
                        local device
                        network_is_up $net || continue
-                       network_get_device device "$net" && {
-                               local subnet
-                               network_get_subnet  subnet "$net" && echo -n "$subnet "
-                               network_get_subnet6 subnet "$net" && echo -n "$subnet "
-                       }
-
+                       network_get_device device "$net"
                        echo -n "${device:-$net} "
                done
        )
@@ -28,9 +23,9 @@ smb_header() {
        local name workgroup description charset
        local hostname="$(uci_get system.@system[0].hostname)"
 
-       config_get name        $1 name        "${hostname:-Lede}"
-       config_get workgroup   $1 workgroup   "${hostname:-Lede}"
-       config_get description $1 description "Samba on ${hostname:-Lede}"
+       config_get name        $1 name        "${hostname:-libreCMC}"
+       config_get workgroup   $1 workgroup   "${hostname:-libreCMC}"
+       config_get description $1 description "Samba on ${hostname:-libreCMC}"
        config_get charset     $1 charset     "UTF-8"
 
        mkdir -p /var/etc
@@ -89,6 +84,8 @@ smb_add_share() {
 
 init_config() {
        config_load samba
+       CONFIG_APPEND=1 UCI_CONFIG_DIR=/var/run/config config_load samba
+
        config_foreach smb_header samba
        config_foreach smb_add_share sambashare
 }
@@ -106,6 +103,7 @@ start_service() {
        init_config
 
        procd_open_instance
+       procd_add_mdns "smb" "tcp" "445"
        procd_set_param command /usr/sbin/smbd -F
        procd_set_param respawn
        procd_set_param file /var/etc/smb.conf