Writing your own telnet commands
An example module that adds a command to the telnet console:
module:set_global();
local env = module:shared("/*/admin_telnet/env");
env.mycommands = {} -- a table to keep your commands in
function env.mycommands:hello()
return "Hello, World!";
end
With this saved in a mod_my_telnet_command.lua
and loaded you should be able to call this command like so:
mycommands:hello()
| OK: Hello, World!
It is also possible to output additional data and indicate success or failure: