diff options
author | Kim Alvefur <zash@zash.se> | 2017-09-18 17:06:35 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-09-18 17:06:35 +0200 |
commit | e49577528abf2b24b5c334ade8c2ef9ae05b3cb7 (patch) | |
tree | 24e1fdc33ec6806cd57984492500f8188aafdcf1 | |
parent | 7ffd14c954944fdbf2e7b59d44408213bced7219 (diff) | |
download | prosody-e49577528abf2b24b5c334ade8c2ef9ae05b3cb7.tar.gz prosody-e49577528abf2b24b5c334ade8c2ef9ae05b3cb7.zip |
prosodyctl: Use all enabled hosts if no hostnames passed to cert import
-rwxr-xr-x | prosodyctl | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 |