Super tiny library for configuring samba shares with Javascript.
- generateShareConfig: Generate configuration for a new samba share.
generateShareConfig: function (shareName, params)
- shareName: Name of the new share.
- params: JSON with the settings of the new share. The keys inside this JSON are the standard samba share configuration options.
- generateSection: Generate include line into the samba configuration.
generateSection: function (shareName, fileName, existingConfig)
- shareName: Name of the new share.
- fileName: Name of the file, which contains the configuration of the new share.
- existingConfig: The already existing Samba configuration object.
- updateConfig: Generate share configuration and include configuration for the new share.
updateConfig: function (configPath, sectionFileName, sectionName, sectionParams)
- configpath: Path of the Samba configuration file.
- sectionFileName: Filename of the newly generated share.
- sectionName: Name of the new share.
- sectionParams: Configuration options for the share.
await Generator.updateConfig('/etc/samba/smb.conf', 'developer.share.conf', 'developer', {path: '/srv/smb/developer'})
The main Samba configuration file is in the /etc/samba directory. The name of the new share is develper, the properties for this share is JSON Object: {path: '/srv/smb/developer'} and the name of the share configuration file is developer.share.conf
Change log is available: here