Annotate

plugins/mod_console.lua @ 440:dee02bf4656a

Some mod_console updates
author Matthew Wild <mwild1@gmail.com>
date Thu, 27 Nov 2008 17:09:21 +0000
parent 411:64982773cc15
child 444:77485b9b840c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
382
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 local connlisteners_register = require "net.connlisteners".register;
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 local console_listener = { default_port = 5582; default_mode = "*l"; };
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 local commands = {};
411
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
7 local def_env = {};
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
8 local default_env_mt = { __index = def_env };
382
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 console = {};
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 function console:new_session(conn)
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 local w = conn.write;
411
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
14 local session = { conn = conn;
382
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15 send = function (t) w(tostring(t)); end;
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16 print = function (t) w("| "..tostring(t).."\n"); end;
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
17 disconnect = function () conn.close(); end;
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
18 };
411
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
19 session.env = setmetatable({}, default_env_mt);
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
20
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
21 -- Load up environment with helper objects
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
22 for name, t in pairs(def_env) do
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
23 if type(t) == "table" then
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
24 session.env[name] = setmetatable({ session = session }, { __index = t });
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
25 end
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
26 end
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
27
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
28 return session;
382
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
29 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
30
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31 local sessions = {};
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33 function console_listener.listener(conn, data)
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
34 local session = sessions[conn];
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
35
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
36 if not session then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
37 -- Handle new connection
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
38 session = console:new_session(conn);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
39 sessions[conn] = session;
440
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
40 printbanner(session);
382
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
41 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
42 if data then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
43 -- Handle data
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
44
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
45 if data:match("[!.]$") then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46 local command = data:lower();
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
47 command = data:match("^%w+") or data:match("%p");
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
48 if commands[command] then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
49 commands[command](session, data);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
50 return;
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
51 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
52 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
53
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
54 session.env._ = data;
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
55
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
56 local chunk, err = loadstring("return "..data);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
57 if not chunk then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
58 chunk, err = loadstring(data);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
59 if not chunk then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
60 err = err:gsub("^%[string .-%]:%d+: ", "");
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
61 err = err:gsub("^:%d+: ", "");
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
62 err = err:gsub("'<eof>'", "the end of the line");
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
63 session.print("Sorry, I couldn't understand that... "..err);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
64 return;
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
65 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
66 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
67
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
68 setfenv(chunk, session.env);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
69 local ranok, taskok, message = pcall(chunk);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
70
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
71 if not ranok then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
72 session.print("Fatal error while running command, it did not complete");
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
73 session.print("Error: "..taskok);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
74 return;
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
75 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
76
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
77 if not message then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
78 session.print("Result: "..tostring(taskok));
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
79 return;
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
80 elseif (not taskok) and message then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
81 session.print("Command completed with a problem");
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
82 session.print("Message: "..tostring(message));
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
83 return;
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
84 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
85
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
86 session.print("OK: "..tostring(message));
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
87 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
88 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
89
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
90 function console_listener.disconnect(conn, err)
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
91
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
92 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
93
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
94 connlisteners_register('console', console_listener);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
95
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
96 -- Console commands --
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
97 -- These are simple commands, not valid standalone in Lua
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
98
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
99 function commands.bye(session)
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
100 session.print("See you! :)");
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
101 session.disconnect();
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
102 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
103
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
104 commands["!"] = function (session, data)
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
105 if data:match("^!!") then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
106 session.print("!> "..session.env._);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
107 return console_listener.listener(session.conn, session.env._);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
108 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
109 local old, new = data:match("^!(.-[^\\])!(.-)!$");
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
110 if old and new then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
111 local ok, res = pcall(string.gsub, session.env._, old, new);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
112 if not ok then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
113 session.print(res)
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
114 return;
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
115 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
116 session.print("!> "..res);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
117 return console_listener.listener(session.conn, res);
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
118 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
119 session.print("Sorry, not sure what you want");
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
120 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
121
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
122 -- Session environment --
411
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
123 -- Anything in def_env will be accessible within the session as a global variable
382
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
124
411
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
125 def_env.server = {};
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
126 function def_env.server:reload()
382
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
127 dofile "main.lua"
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
128 return true, "Server reloaded";
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
129 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
130
411
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
131 def_env.module = {};
440
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
132 function def_env.module:load(name, host)
382
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
133 local mm = require "modulemanager";
440
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
134 local ok, err = mm.load(host or self.env.host, name);
382
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
135 if not ok then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
136 return false, err or "Unknown error loading module";
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
137 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
138 return true, "Module loaded";
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
139 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
140
411
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
141 def_env.config = {};
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
142 function def_env.config:load(filename, format)
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
143 local config_load = require "core.configmanager".load;
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
144 local ok, err = config_load(filename, format);
382
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
145 if not ok then
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
146 return false, err or "Unknown error loading config";
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
147 end
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
148 return true, "Config loaded";
9daf1e3d278e Add initial mod_console
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
149 end
411
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
150
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
151 function def_env.config:get(host, section, key)
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
152 local config_get = require "core.configmanager".get
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
153 return true, tostring(config_get(host, section, key));
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
154 end
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
155
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
156 def_env.hosts = {};
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
157 function def_env.hosts:list()
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
158 for host, host_session in pairs(hosts) do
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
159 self.session.print(host);
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
160 end
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
161 return true, "Done";
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
162 end
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
163
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
164 function def_env.hosts:add(name)
64982773cc15 Some mod_console changes
Matthew Wild <mwild1@gmail.com>
parents: 382
diff changeset
165 end
440
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
166
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
167 -------------
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
168
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
169 function printbanner(session)
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
170 session.print [[
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
171 ____ \ / _
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
172 | _ \ _ __ ___ ___ _-_ __| |_ _
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
173 | |_) | '__/ _ \/ __|/ _ \ / _` | | | |
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
174 | __/| | | (_) \__ \ |_| | (_| | |_| |
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
175 |_| |_| \___/|___/\___/ \__,_|\__, |
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
176 A study in simplicity |___/
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
177
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
178 ]]
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
179 session.print("Welcome to the Prosody administration console. For a list of commands, type: help");
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
180 session.print("You may find more help on using this console in our online documentation at ");
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
181 session.print("http://prosody.im/doc/console\n");
dee02bf4656a Some mod_console updates
Matthew Wild <mwild1@gmail.com>
parents: 411
diff changeset
182 end