aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-04-29 14:01:19 +0200
committerKim Alvefur <zash@zash.se>2013-04-29 14:01:19 +0200
commit880e39cd91eb189b6fe1e8ed028b446d6b312931 (patch)
tree42d11080b7f3bc1cb02622189b19a148a481081e
parent11ff95b32fc14b91685628afc3104edc65033d61 (diff)
downloadprosody-880e39cd91eb189b6fe1e8ed028b446d6b312931.tar.gz
prosody-880e39cd91eb189b6fe1e8ed028b446d6b312931.zip
prosodyctl: Guess the country from the TLD for the cert config
-rwxr-xr-xprosodyctl5
1 files changed, 5 insertions, 0 deletions
diff --git a/prosodyctl b/prosodyctl
index 88daf11b..247b099a 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -670,6 +670,11 @@ function cert_commands.config(arg)
v = arg[1]
elseif k == "emailAddress" then
v = "xmpp@" .. arg[1];
+ elseif k == "countryName" then
+ local tld = arg[1]:match"%.([a-z]+)$";
+ if tld and #tld == 2 and tld ~= "uk" then
+ v = tld:upper();
+ end
end
nv = show_prompt(("%s (%s):"):format(k, nv or v));
nv = (not nv or nv == "") and v or nv;