diff options
Diffstat (limited to 'awall/util.lua')
-rw-r--r-- | awall/util.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/awall/util.lua b/awall/util.lua index df6579a..ad067b7 100644 --- a/awall/util.lua +++ b/awall/util.lua @@ -1,12 +1,15 @@ --[[ Utility module for Alpine Wall -Copyright (C) 2012-2017 Kaarle Ritvanen +Copyright (C) 2012-2019 Kaarle Ritvanen See LICENSE file for license details ]]-- local M = {} +local lpc = require('lpc') + + function M.split(s, sep) if s == '' then return {} end local res = {} @@ -150,4 +153,12 @@ function M.printtabular(tbl) M.printtabulars({tbl}) end function M.printmsg(msg) io.stderr:write(msg..'\n') end + +function M.run(...) + local pid, stdin, stdout = lpc.run(...) + stdin:close() + stdout:close() + return pid +end + return M |