libs/sys: recent busybox versions changed top output from %MEM to %VSZ, fix luci...
[project/luci.git] / libs / sys / luasrc / sys.lua
index 53204b1..f9b253e 100644 (file)
@@ -526,6 +526,9 @@ function process.list()
                end
 
                k = luci.util.split(luci.util.trim(line), "%s+", nil, true)
+               if k[6] == "%VSZ" then
+                       k[6] = "%MEM"
+               end
                if k[1] == "PID" then
                        break
                end
@@ -791,7 +794,7 @@ end
 -- @return             Boolean indicating whether init is enabled
 function init.enabled(name)
        if fs.access(init.dir..name) then
-               return ( call(init.dir..name.." enabled") == 0 )
+               return ( call(init.dir..name.." enabled >/dev/null") == 0 )
        end
        return false
 end
@@ -801,7 +804,7 @@ end
 -- @return             Numeric index value
 function init.index(name)
        if fs.access(init.dir..name) then
-               return call("source "..init.dir..name.." enabled; exit $START")
+               return call("source "..init.dir..name.." enabled >/dev/null; exit $START")
        end
 end
 
@@ -810,7 +813,7 @@ end
 -- @return             Boolean indicating success
 function init.enable(name)
        if fs.access(init.dir..name) then
-               return ( call(init.dir..name.." enable") == 1 )
+               return ( call(init.dir..name.." enable >/dev/null") == 1 )
        end
 end
 
@@ -819,7 +822,7 @@ end
 -- @return             Boolean indicating success
 function init.disable(name)
        if fs.access(init.dir..name) then
-               return ( call(init.dir..name.." disable") == 0 )
+               return ( call(init.dir..name.." disable >/dev/null") == 0 )
        end
 end