From 1425d5ef90330d8cc7e1c27d54c1b5f67235dd98 Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 17 Oct 2013 12:08:03 +0200 Subject: [PATCH] More network logging --- src/main.lua | 2 +- src/network/netconfig.lua | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main.lua b/src/main.lua index 0c1a78e..0aa18e3 100644 --- a/src/main.lua +++ b/src/main.lua @@ -154,7 +154,7 @@ local function init(environment) s, msg = wifi.init() if not s then return s, msg end - s, msg = netconf.init(wifi, true) + s, msg = netconf.init(wifi, false) if not s then return s, msg end return true diff --git a/src/network/netconfig.lua b/src/network/netconfig.lua index 1b129f0..4260cab 100644 --- a/src/network/netconfig.lua +++ b/src/network/netconfig.lua @@ -76,9 +76,15 @@ function M.commitComponent(c) end function M.reloadComponent(c, silent) - log:info("reloading component '" .. c .. "'") - if silent ~= nil and silent then os.execute('/etc/init.d/' .. c .. ' reload &> /dev/null') - else os.execute('/etc/init.d/' .. c .. ' reload') end + log:info("reloading component '" .. c .. "'") + local cmd = '/etc/init.d/' .. c .. ' reload' + if silent ~= nil and silent then + cmd = cmd .. ' &> /dev/null' + os.execute(cmd) + else + rv = utils.captureCommandOutput(cmd) + log:info(" result reloading component '" .. c .. "': "..utils.dump(rv)) + end end function M.uciTableSet(config, section, options)