diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-01-23 21:59:13 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-01-23 21:59:13 +0000 |
commit | a703f272846902f05b9ca20ca5d0afba461e8081 (patch) | |
tree | 47c8c97f6d323069856a175b320f929a8910a30b | |
parent | 348f638b3a395d8bb593b0cc9c93812bf9b49c4b (diff) | |
download | prosody-a703f272846902f05b9ca20ca5d0afba461e8081.tar.gz prosody-a703f272846902f05b9ca20ca5d0afba461e8081.zip |
prosodyctl: Fix some luacheck warnings
-rwxr-xr-x | prosodyctl | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -69,6 +69,7 @@ local modulemanager = require "core.modulemanager" local prosodyctl = require "util.prosodyctl" local socket = require "socket" local dependencies = require "util.dependencies"; +local lfs = dependencies.softreq "lfs"; ----------------------- @@ -198,14 +199,15 @@ function commands.deluser(arg) 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 @@ function commands.unregister(arg) end local openssl; -local lfs; local cert_commands = {}; |