Howdy.
If I do something ugly like a while loop that greps for the share name and toggle the smb share a few times I can discover that the general gist is along the lines of:
However, if you try to call `net --json conf showshare` when the share has been disabled, it returns SBC_ERR_NO_SUCH_SERVICE.
I suppose I can store the returned json data from `showshare` to be used later for the `addshare`.
Does anyone have tips for how I might automate the enabling and disabling of samba shares?
(My specific use case is when mounting my pool over SSH, the shares must be toggled in the webgui before files are accessible to clients.)
If I do something ugly like a while loop that greps for the share name and toggle the smb share a few times I can discover that the general gist is along the lines of:
Code:
share_name=baz_share ## disable share net --json conf showshare "$share_name" net --json conf setparm <JSON_DATA> smbcontrol smbd close-share "$share_name" net conf delshare "$share_name" ## enable share net --json conf showshare "$share_name" net --json conf addshare <JSON_DATA>
However, if you try to call `net --json conf showshare` when the share has been disabled, it returns SBC_ERR_NO_SUCH_SERVICE.
I suppose I can store the returned json data from `showshare` to be used later for the `addshare`.
Does anyone have tips for how I might automate the enabling and disabling of samba shares?
(My specific use case is when mounting my pool over SSH, the shares must be toggled in the webgui before files are accessible to clients.)