module (..., package.seeall) require "fs" local function getLbuStatus() local ret = {} local f = io.popen("/sbin/lbu status -v", "r") if not f then return ret end for line in f:lines() do local status, name = string.match(line, "^(%S+)%s+(.+)$") if status and name then ret[string.gsub('/' .. name, "/+", "/")] = status end end f:close() return ret end function list(self) local ret = {} local lbuStatus = getLbuStatus() for k,v in pairs(lbuStatus) do ret[#ret + 1] = { name=k, status=v } end return ret end function commit(self) local f = io.popen("/sbin/lbu commit", 'r') if not f then return false, "cannot run lbu" end local ret = f:read("*a") f:close() return true, ret end