diff --git a/plugins/sh.lua b/plugins/sh.lua index b88f776..3e299fa 100644 --- a/plugins/sh.lua +++ b/plugins/sh.lua @@ -39,7 +39,6 @@ local function run(msg, matches) if string.match(msg.text, '^#[Ss][Cc][Rr][Ee][Ee][Nn]$') then text = run_bash("scrot 'scrot.png' -e 'mv $f ~/Mikubot/tmp/'") send_photo(get_receiver(msg), "tmp/scrot.png", ok_cb, false) - return 'Screenshot wird gesendet!' end -- Requires fswebcam (sudo apt-get install fswebcam) @@ -53,6 +52,12 @@ local function run(msg, matches) text = 'Es gibt '..string.match(cmd, '(%d+) aktualisiert')..' Updates' return text end + + -- Requires vnstat & vnstati (sudo apt-get install vnstat vnstati) + if string.match(msg.text, '^#[Tt][Rr][Aa][Ff][Ff][Ii][Cc]$') then + text = run_bash("vnstati -m -vs -i enp2s0 -o tmp/vnstat.png") + send_photo(get_receiver(msg), "tmp/vnstat.png", ok_cb, false) + end end @@ -63,7 +68,8 @@ return { "^#[Uu][Pp][Tt][Ii][Mm][Ee]$", "^#[Ss][Cc][Rr][Ee][Ee][Nn]$", "^#[Cc][Hh][Ee][Cc][Kk]$", - "^#[Ww][Ee][Bb][Cc][Aa][Mm]$" + "^#[Ww][Ee][Bb][Cc][Aa][Mm]$", + "^#[Tt][Rr][Aa][Ff][Ff][Ii][Cc]$" }, run = run, privileged = true