From 2751b413f8a0d7fce6a8fb0dfa68523e7065b465 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 29 Apr 2013 14:01:19 +0200 Subject: [PATCH] prosodyctl: Guess the country from the TLD for the cert config --- prosodyctl | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.30.2