This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot/plugins/ping.lua
2014-12-16 21:50:19 +01:00

22 lines
466 B
Lua

socket = require("socket")
function cron()
-- Checks a TCP connexion
-- Use yours desired web and id
local addr = "your.web.site"
local dest = "user#id"..our_id
if not socket.connect(addr, 80) then
local text = "ALERT: "..addr.." is offline"
print (text)
send_msg(dest, text, ok_cb, false)
end
end
return {
description = "If domain is offline, send msg to peer",
usage = "",
patterns = {},
run = nil,
cron = cron
}