From 99afa43f5012dcf5896a37aae2aa8e4981481863 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Wed, 19 Aug 2015 15:15:24 +0200 Subject: [PATCH] new plugin curl_head.lua --- plugins/curl_head.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 plugins/curl_head.lua diff --git a/plugins/curl_head.lua b/plugins/curl_head.lua new file mode 100644 index 0000000..ac7b467 --- /dev/null +++ b/plugins/curl_head.lua @@ -0,0 +1,20 @@ +function run(msg, matches) + local receiver = get_receiver(msg) + local URL = matches[1] + if string.match(msg.text, '"') then + return 'Vergiss es' + end + + if string.match(msg.text, '/[Hh][Ee][Aa][Dd]') then + text = run_bash('curl --head --insecure ' .. URL) + send_msg(receiver, text, ok_cb, false) + end + +end + +return { + description = "Führt Befehle in der Konsole aus", + usage = {""}, + patterns = {"^/[Hh][Ee][Aa][Dd] (https?://[%w-_%.%?%.:/%+=&]+)$"}, + run = run +} \ No newline at end of file