projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
993b368
)
prosodyctl: Guess the country from the TLD for the cert config
author
Kim Alvefur
<zash@zash.se>
Mon, 29 Apr 2013 12:01:19 +0000
(14:01 +0200)
committer
Kim Alvefur
<zash@zash.se>
Mon, 29 Apr 2013 12:01:19 +0000
(14:01 +0200)
prosodyctl
patch
|
blob
|
history
diff --git
a/prosodyctl
b/prosodyctl
index 88daf11b16296b645134090395ddfceb66e8ec78..247b099a94f73a30109a7139e45103a9fe32332f 100755
(executable)
--- 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;