diff options
author | Kim Alvefur <zash@zash.se> | 2017-09-18 18:28:29 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-09-18 18:28:29 +0200 |
commit | 21a8486ac52a4ff2b91435eba19c7067277528dc (patch) | |
tree | be2cc52356cecf821ed7f4cce11d2b64c6c7ca87 /prosodyctl | |
parent | 027e7a5b81e443487b897c29f9e1f51f12aba445 (diff) | |
download | prosody-21a8486ac52a4ff2b91435eba19c7067277528dc.tar.gz prosody-21a8486ac52a4ff2b91435eba19c7067277528dc.zip |
prosodyctl: cert import: Use env variable set by certbot if invoked as post-renew hook
Diffstat (limited to 'prosodyctl')
-rwxr-xr-x | prosodyctl | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -871,10 +871,17 @@ function cert_commands.import(arg) 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 + local domains = os.getenv"RENEWED_DOMAINS"; -- Set if invoked via certbot + if domains then + for host in domains:gmatch("%S+") do table.insert(hostnames, host); end + else + for host in pairs(prosody.hosts) do + if host ~= "*" and config.get(host, "enabled") ~= false then + table.insert(hostnames, host); + end + end end end if not arg[1] or arg[1] == "--help" then -- Probably forgot the path |