diff --git a/bot/utils.lua b/bot/utils.lua index d8b90c5..043844d 100644 --- a/bot/utils.lua +++ b/bot/utils.lua @@ -110,4 +110,12 @@ function scandir(directory) t[i] = filename end return t -end \ No newline at end of file +end + +-- http://www.lua.org/manual/5.2/manual.html#pdf-io.popen +function run_command(str) + local cmd = io.popen(str) + local result = cmd:read('*all') + cmd:close() + return result +end