From 8b8299e254aa8ac60da83308d94d97ff89099ed4 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Sun, 28 Feb 2016 15:09:04 +0100 Subject: [PATCH] Updatecheck --- plugins/sh.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/sh.lua b/plugins/sh.lua index a8e1632..c28aba7 100644 --- a/plugins/sh.lua +++ b/plugins/sh.lua @@ -32,6 +32,12 @@ function run(msg, matches) print(text) return 'Upgrade durchgeführt!' end + + if string.match(msg.text, '^/[Cc][Hh][Ee][Cc][Kk]$') then + cmd = run_bash("sudo apt-get --just-print upgrade") + text = 'Es gibt '..string.match(cmd, '(%d+) aktualisiert')..' Updates' + return text + end -- vcgencmd works only on Raspberry Pi if string.match(msg.text, '^/[Tt][Ee][Mm][Pp]$') then @@ -64,7 +70,8 @@ return { "^/[Uu][Pp][Gg][Rr][Aa][Dd][Ee]$", "^/[Tt][Ee][Mm][Pp]$", "^/[Vv][Oo][Ll][Tt]$", - "^/[Tt][Aa][Kk][Tt]$" + "^/[Tt][Aa][Kk][Tt]$", + "^/[Cc][Hh][Ee][Cc][Kk]$" }, run = run, privileged = true