Updatecheck

This commit is contained in:
Akamaru 2016-02-28 15:09:04 +01:00
parent 1924eddeaa
commit 8b8299e254

View File

@ -33,6 +33,12 @@ function run(msg, matches)
return 'Upgrade durchgeführt!' return 'Upgrade durchgeführt!'
end 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 -- vcgencmd works only on Raspberry Pi
if string.match(msg.text, '^/[Tt][Ee][Mm][Pp]$') then if string.match(msg.text, '^/[Tt][Ee][Mm][Pp]$') then
text = run_bash('vcgencmd measure_temp') text = run_bash('vcgencmd measure_temp')
@ -64,7 +70,8 @@ return {
"^/[Uu][Pp][Gg][Rr][Aa][Dd][Ee]$", "^/[Uu][Pp][Gg][Rr][Aa][Dd][Ee]$",
"^/[Tt][Ee][Mm][Pp]$", "^/[Tt][Ee][Mm][Pp]$",
"^/[Vv][Oo][Ll][Tt]$", "^/[Vv][Oo][Ll][Tt]$",
"^/[Tt][Aa][Kk][Tt]$" "^/[Tt][Aa][Kk][Tt]$",
"^/[Cc][Hh][Ee][Cc][Kk]$"
}, },
run = run, run = run,
privileged = true privileged = true