diff options
Diffstat (limited to 'tinydns-model.lua')
-rw-r--r-- | tinydns-model.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tinydns-model.lua b/tinydns-model.lua index 7bfa69e..00918ca 100644 --- a/tinydns-model.lua +++ b/tinydns-model.lua @@ -76,6 +76,20 @@ local function recursedir(path, filearray) end end +local function autostarts() + local cmd_output_result + local cmd = "/sbin/rc_status | egrep '^S' | egrep '" .. processname .."' 2>/dev/null" + local f = io.popen( cmd ) + local cmdresult = f:read("*a") + if (cmdresult) and (#cmdresult > 0) then + cmd_output_result = "Process will autostart at next boot (at sequence '" .. string.match(cmdresult,"^%a+(%d%d)") .. "')" + else + cmd_output_error = "Not programmed to autostart" + end + f:close() + return cmd_output_result, cmd_output_error +end + -- Functin to split items into a table local function split_config_items(orgitem) local delimiter = ":" @@ -253,6 +267,13 @@ function getstatus() value=configfiles, }) + local autostart_sequense, autostart_errtxt = autostarts() + status.autostart = cfe({ name="autostart", + label="Autostart sequence", + value=autostart_sequense, + errtxt=autostart_errtxt, + }) + return status end |