Changeset

5547:f306daf2bf6d

prosodyctl: Guess the country from the TLD for the cert config
author Kim Alvefur <zash@zash.se>
date Mon, 29 Apr 2013 14:01:19 +0200
parents 5546:edc97af48d19
children 5548:c5d1c35c93f4
files prosodyctl
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/prosodyctl	Mon Apr 29 14:00:44 2013 +0200
+++ b/prosodyctl	Mon Apr 29 14:01:19 2013 +0200
@@ -670,6 +670,11 @@
 					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;