module(..., package.seeall) require("privsep") require("join") -- those should go into acf.conf local user="nobody" local group="nobody" -- drop privileges and put privileged model funcs in self.priv mvc = {} function mvc.on_load(self) self.priv = privsep.drop_privs(user, group, self.model.priv) end function basic(self) local ctl = {} local opts = self.model.readopts() ctl.pidlist = self.priv.is_enabled() if pidlist then ctl.enabled = "checked=yes" ctl.disabled = "" else ctl.enabled = "" ctl.disabled = "checked=yes" end ctl.opts = opts if opts and opts.remote then ctl.remote = "checked" ctl.host = opts.remote else ctl.remote = "" ctl.host = "" end ctl.debug="opts="..tostring(opts) return ctl end