+tmpl = s:taboption("template", Value, "_tmpl",
+ translate("Edit the template that is used for generating the samba configuration."),
+ translate("This is the content of the file '/etc/samba/smb.conf.template' from which your samba configuration will be generated. " ..
+ "Values enclosed by pipe symbols ('|') should not be changed. They get their values from the 'General Settings' tab."))
+
+tmpl.template = "cbi/tvalue"
+tmpl.rows = 20
+
+function tmpl.cfgvalue(self, section)
+ return nixio.fs.readfile("/etc/samba/smb.conf.template")
+end
+
+function tmpl.write(self, section, value)
+ value = value:gsub("\r\n?", "\n")
+ nixio.fs.writefile("//etc/samba/smb.conf.template", value)
+end
+