mod_pubsub_serverinfo: Update to use mod_server_info (fixes #1841)
...but only for Prosody trunk users, because 0.12 mod_server_contact_info does
not use the new API in mod_server_info.
module:set_global();
local portmanager = require "core.portmanager";
local commands = module:shared("admin_shell/commands")
function commands.portcheck(session, line)
for desc, interface, port in line:gmatch("%s(%[?([%x:.*]+)%]?:(%d+))") do
assert(portmanager.get_service_at(interface, tonumber(port)), desc);
end
session.print "OK";
end
function module.unload()
commands.portcheck = nil;
end