Diff

prosodyctl @ 10610:b9a054ad38e7 0.11

prosodyctl: Fix some luacheck warnings
author Matthew Wild <mwild1@gmail.com>
date Thu, 23 Jan 2020 21:59:13 +0000
parent 10608:87003b937672
child 10611:c10511380c0f
child 11529:10bea0941bab
line wrap: on
line diff
--- a/prosodyctl	Thu Jan 23 21:43:36 2020 +0000
+++ b/prosodyctl	Thu Jan 23 21:59:13 2020 +0000
@@ -69,6 +69,7 @@
 local prosodyctl = require "util.prosodyctl"
 local socket = require "socket"
 local dependencies = require "util.dependencies";
+local lfs = dependencies.softreq "lfs";
 
 -----------------------
 
@@ -198,14 +199,15 @@
 	return 1;
 end
 
-local function service_command_warning(command)
+local function service_command_warning(service_command)
 	if prosody.installed and configmanager.get("*", "prosodyctl_service_warnings") ~= false then
 		show_warning("WARNING: Use of prosodyctl start/stop/restart/reload is not recommended");
 		show_warning("         if Prosody is managed by an init system - use that directly instead.");
+		lfs = lfs or require
 		if lfs.attributes("/etc/systemd") then
-			show_warning("         e.g. systemctl %s prosody", command);
+			show_warning("         e.g. systemctl %s prosody", service_command);
 		elseif lfs.attributes("/etc/init.d/prosody") then
-			show_warning("         e.g. /etc/init.d/prosody %s", command);
+			show_warning("         e.g. /etc/init.d/prosody %s", service_command);
 		end
 		show_warning("");
 	end
@@ -512,7 +514,6 @@
 end
 
 local openssl;
-local lfs;
 
 local cert_commands = {};