Skip to content

Commit

Permalink
samba36: append config from /var/run/config/ for runtime shares
Browse files Browse the repository at this point in the history
This will allow automation/hotplug.d scripts to store runtime shares in
the /var/run/config/samba. It's useful e.g. for USB drives that user
wants to be automatically shared.

Using /var/run/config/ provides:
1) Automated cleaning on reboots
   It's important for consistency (to avoid sharing non-existing drives)
2) Safety for user non-commited changes
   Automated scripts should never call "uci [foo] commit" as that could
   flush incomplete config.

Another minor gain is avoiding flash wearing for runtime setup.

Cc: Rosy Song <rosysong@rosinson.com>
Cc: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  • Loading branch information
Rafał Miłecki committed Jan 10, 2019
1 parent 7175b13 commit 5a59e2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package/network/services/samba36/files/samba.init
Original file line number Diff line number Diff line change
Expand Up @@ -84,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
}
Expand Down

0 comments on commit 5a59e2c

Please sign in to comment.