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-model.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'shorewall-model.lua') 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 -- cgit v1.2.3