Comparison

util/prosodyctl/shell.lua @ 10868:fa06cf7059cd

util.prosodyctl.shell: Use same config option as module for socket path So now if you set it to a custom value, both the client and the server should use it.
author Kim Alvefur <zash@zash.se>
date Mon, 01 Jun 2020 23:53:03 +0200
parent 10867:561138169983
child 10869:c91697b81349
comparison
equal deleted inserted replaced
10867:561138169983 10868:fa06cf7059cd
4 print("** LuaSocket unix socket support not available or incompatible, ensure your"); 4 print("** LuaSocket unix socket support not available or incompatible, ensure your");
5 print("** version is up to date."); 5 print("** version is up to date.");
6 os.exit(1); 6 os.exit(1);
7 end 7 end
8 8
9 local config = require "core.configmanager";
9 local server = require "net.server"; 10 local server = require "net.server";
10 local st = require "util.stanza"; 11 local st = require "util.stanza";
11 local path = require "util.paths"; 12 local path = require "util.paths";
12 13
13 local have_readline, readline = pcall(require, "readline"); 14 local have_readline, readline = pcall(require, "readline");
111 if stanza.name == "repl-result" then 112 if stanza.name == "repl-result" then
112 repl(client); 113 repl(client);
113 end 114 end
114 end); 115 end);
115 116
116 local socket_path = path.join(prosody.paths.data, "prosody.sock"); 117 local socket_path = path.resolve_relative_path(prosody.paths.data, config.get("*", "admin_socket") or "prosody.sock");
117 local conn = connection(socket_path, client.listeners); 118 local conn = connection(socket_path, client.listeners);
118 local ok, err = conn:connect(); 119 local ok, err = conn:connect();
119 if not ok then 120 if not ok then
120 print("** Unable to connect to server - is it running? Is mod_admin_shell enabled?"); 121 print("** Unable to connect to server - is it running? Is mod_admin_shell enabled?");
121 print("** Connection error: "..err); 122 print("** Connection error: "..err);