module(..., package.seeall) require("procps") local processname = "tinydns" local configfile = "???" -- ################################################################################ -- LOCAL FUNCTIONS local function get_version() local cmd = "/sbin/apk_version -vs " .. processname .." 2>/dev/null" local f = io.popen( cmd ) local cmd_output_result = f:read("*l") f:close() return cmd_output_result end -- ################################################################################ -- PUBLIC FUNCTIONS function getstatus() -- local opts = getconfig() local status = {} status.version = cfe({ name = "version", label="Program version", value=get_version(), }) status.status = cfe({ name="status", label="Program status", value=procps.pidof(processname), }) --[[ if (opts["remotelogging"]) and not ((opts["remotelogging"]["value"] ~= "") and not (opts["localandnetworklog"]["value"])) then status.logfile = cfe({ name="logfile", label="Locally logging to", value=opts["logfile"]["value"], }) end if (opts["SYSLOGD_OPTS"]) and (opts["SYSLOGD_OPTS"]["-R"]) and (opts["SYSLOGD_OPTS"]["-R"] ~= "") then status.remote = cfe({ name="remotelogging", label="Remote logging to", value=opts["SYSLOGD_OPTS"]["-R"], }) end --]] return status end