diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-03-28 13:58:14 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-03-28 13:58:14 +0000 |
commit | de749eb0ae7f08b1cf7d214f39ea5bbf21fa4485 (patch) | |
tree | cc94e8e239875dcfb43ca7498cb028c6b1422f87 /shorewall-model.lua | |
parent | 65405bacfc4055feeae802634455b19046c27414 (diff) | |
download | acf-shorewall-de749eb0ae7f08b1cf7d214f39ea5bbf21fa4485.tar.bz2 acf-shorewall-de749eb0ae7f08b1cf7d214f39ea5bbf21fa4485.tar.xz |
Adding information of autostart sequence.
git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@861 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'shorewall-model.lua')
-rw-r--r-- | shorewall-model.lua | 21 |
1 files changed, 21 insertions, 0 deletions
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 |