prosodyctl
changeset 8251 259e0010a6d4
parent 8250 2c386ee5cd5c
child 8252 cc664a3917e2
--- a/prosodyctl	Mon Sep 18 17:06:35 2017 +0200
+++ b/prosodyctl	Mon Sep 18 17:08:31 2017 +0200
@@ -939,13 +939,15 @@
 		end
 		local subcmd = table.remove(arg, 1);
 		if type(cert_commands[subcmd]) == "function" then
-			if not arg[1] then
-				show_message"You need to supply at least one hostname"
-				arg = { "--help" };
-			end
-			if arg[1] ~= "--help" and not hosts[arg[1]] then
-				show_message(error_messages["no-such-host"]);
-				return 1;
+			if subcmd ~= "import" then -- hostnames are optional for import
+				if not arg[1] then
+					show_message"You need to supply at least one hostname"
+					arg = { "--help" };
+				end
+				if arg[1] ~= "--help" and not hosts[arg[1]] then
+					show_message(error_messages["no-such-host"]);
+					return 1;
+				end
 			end
 			return cert_commands[subcmd](arg);
 		elseif subcmd == "check" then