aboutsummaryrefslogtreecommitdiffstats
path: root/prosodyctl
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-09-18 17:06:35 +0200
committerKim Alvefur <zash@zash.se>2017-09-18 17:06:35 +0200
commit51cfd5b4c7b485ad72c8aa9950b3403a14f67a89 (patch)
tree24e1fdc33ec6806cd57984492500f8188aafdcf1 /prosodyctl
parent6c31ce7205feca1d29fbd56f8e3bc0e21eb0e4ef (diff)
downloadprosody-51cfd5b4c7b485ad72c8aa9950b3403a14f67a89.tar.gz
prosody-51cfd5b4c7b485ad72c8aa9950b3403a14f67a89.zip
prosodyctl: Use all enabled hosts if no hostnames passed to cert import
Diffstat (limited to 'prosodyctl')
-rwxr-xr-xprosodyctl9
1 files changed, 8 insertions, 1 deletions
diff --git a/prosodyctl b/prosodyctl
index ce81877d..353253ec 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -870,8 +870,15 @@ function cert_commands.import(arg)
while arg[1] and prosody.hosts[ arg[1] ] do
table.insert(hostnames, table.remove(arg, 1));
end
+ if hostnames[1] == nil then
+ for host in pairs(prosody.hosts) do
+ if host ~= "*" and config.get(host, "enabled") ~= false then
+ table.insert(hostnames, host);
+ end
+ end
+ end
if not arg[1] or arg[1] == "--help" then -- Probably forgot the path
- show_usage("cert import HOSTNAME [HOSTNAME+] /path/to/certs [/other/paths/]+",
+ show_usage("cert import [HOSTNAME+] /path/to/certs [/other/paths/]+",
"Copies certificates to "..cert_basedir);
return 1;
end