# HG changeset patch # User Kim Alvefur # Date 1367236879 -7200 # Node ID f306daf2bf6da6993e38e1a37ea811898e0d9020 # Parent edc97af48d19fc41ea11e089c79ecf80ec6b360c prosodyctl: Guess the country from the TLD for the cert config diff -r edc97af48d19 -r f306daf2bf6d prosodyctl --- 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;