From de749eb0ae7f08b1cf7d214f39ea5bbf21fa4485 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Fri, 28 Mar 2008 13:58:14 +0000 Subject: Adding information of autostart sequence. git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@861 ab2d0c66-481e-0410-8bed-d214d4d58bed --- shorewall-check-html.lsp | 2 +- shorewall-edit-html.lsp | 2 +- shorewall-expert-html.lsp | 2 +- shorewall-logfile-html.lsp | 2 +- shorewall-model.lua | 21 +++++++++++++++++++++ shorewall-status-html.lsp | 2 +- 6 files changed, 26 insertions(+), 5 deletions(-) diff --git a/shorewall-check-html.lsp b/shorewall-check-html.lsp index 38d788b..3bd8831 100644 --- a/shorewall-check-html.lsp +++ b/shorewall-check-html.lsp @@ -43,7 +43,7 @@ end

SYSTEM INFO

diff --git a/shorewall-edit-html.lsp b/shorewall-edit-html.lsp index c5f9e6e..f1f7a75 100644 --- a/shorewall-edit-html.lsp +++ b/shorewall-edit-html.lsp @@ -46,7 +46,7 @@ end
diff --git a/shorewall-expert-html.lsp b/shorewall-expert-html.lsp index 8b16c9a..0f7126c 100644 --- a/shorewall-expert-html.lsp +++ b/shorewall-expert-html.lsp @@ -30,7 +30,7 @@ end

SYSTEM INFO

diff --git a/shorewall-logfile-html.lsp b/shorewall-logfile-html.lsp index e7d32b2..04fc548 100644 --- a/shorewall-logfile-html.lsp +++ b/shorewall-logfile-html.lsp @@ -50,7 +50,7 @@ end

SYSTEM INFO

diff --git a/shorewall-model.lua b/shorewall-model.lua index 8f39bdc..b12533d 100644 --- a/shorewall-model.lua +++ b/shorewall-model.lua @@ -195,6 +195,20 @@ local function addremove_config( addremove, file, value, orgvalue ) end --]] +local function autostarts() + local cmd_output_result, cmd_output_error + 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 + -- ################################################################################ -- PUBLIC FUNCTIONS @@ -276,6 +290,13 @@ function getstatus() value=programstate, }) + local autostart_sequense, autostart_errtxt = autostarts() + status.autostart = cfe({ name="autostart", + label="Autostart sequence", + value=autostart_sequense, + errtxt=autostart_errtxt, + }) + return status end diff --git a/shorewall-status-html.lsp b/shorewall-status-html.lsp index 2dc6a2c..e6cbd0d 100644 --- a/shorewall-status-html.lsp +++ b/shorewall-status-html.lsp @@ -23,7 +23,7 @@ end

SYSTEM INFO

-- cgit v1.2.3