Comparison

prosodyctl @ 10611:c10511380c0f

Merge 0.11->trunk
author Matthew Wild <mwild1@gmail.com>
date Thu, 23 Jan 2020 21:59:43 +0000
parent 10609:f35cbfe546d1
parent 10610:b9a054ad38e7
child 10629:eed5811941b2
comparison
equal deleted inserted replaced
10609:f35cbfe546d1 10611:c10511380c0f
66 local configmanager = require "core.configmanager"; 66 local configmanager = require "core.configmanager";
67 local modulemanager = require "core.modulemanager" 67 local modulemanager = require "core.modulemanager"
68 local prosodyctl = require "util.prosodyctl" 68 local prosodyctl = require "util.prosodyctl"
69 local socket = require "socket" 69 local socket = require "socket"
70 local dependencies = require "util.dependencies"; 70 local dependencies = require "util.dependencies";
71 local lfs = dependencies.softreq "lfs";
71 72
72 ----------------------- 73 -----------------------
73 74
74 local show_message, show_warning = prosodyctl.show_message, prosodyctl.show_warning; 75 local show_message, show_warning = prosodyctl.show_message, prosodyctl.show_warning;
75 local show_usage = prosodyctl.show_usage; 76 local show_usage = prosodyctl.show_usage;
220 221
221 show_message(error_messages[msg]) 222 show_message(error_messages[msg])
222 return 1; 223 return 1;
223 end 224 end
224 225
225 local function service_command_warning(command) 226 local function service_command_warning(service_command)
226 if prosody.installed and configmanager.get("*", "prosodyctl_service_warnings") ~= false then 227 if prosody.installed and configmanager.get("*", "prosodyctl_service_warnings") ~= false then
227 show_warning("WARNING: Use of prosodyctl start/stop/restart/reload is not recommended"); 228 show_warning("WARNING: Use of prosodyctl start/stop/restart/reload is not recommended");
228 show_warning(" if Prosody is managed by an init system - use that directly instead."); 229 show_warning(" if Prosody is managed by an init system - use that directly instead.");
230 lfs = lfs or require
229 if lfs.attributes("/etc/systemd") then 231 if lfs.attributes("/etc/systemd") then
230 show_warning(" e.g. systemctl %s prosody", command); 232 show_warning(" e.g. systemctl %s prosody", service_command);
231 elseif lfs.attributes("/etc/init.d/prosody") then 233 elseif lfs.attributes("/etc/init.d/prosody") then
232 show_warning(" e.g. /etc/init.d/prosody %s", command); 234 show_warning(" e.g. /etc/init.d/prosody %s", service_command);
233 end 235 end
234 show_warning(""); 236 show_warning("");
235 end 237 end
236 end 238 end
237 239
549 show_message(error_messages[msg]) 551 show_message(error_messages[msg])
550 return 1; 552 return 1;
551 end 553 end
552 554
553 local openssl; 555 local openssl;
554 local lfs;
555 556
556 local cert_commands = {}; 557 local cert_commands = {};
557 558
558 -- If a file already exists, ask if the user wants to use it or replace it 559 -- If a file already exists, ask if the user wants to use it or replace it
559 -- Backups the old file if replaced 560 -- Backups the old file if replaced