Changeset

12380:3a702f37e87c

prosodyctl: check turn: always show debug info even if test fails
author Matthew Wild <mwild1@gmail.com>
date Sat, 05 Mar 2022 16:07:47 +0000
parents 12379:6ac3c580c00d
children 12381:d999c2b3e289
files util/prosodyctl/check.lua
diffstat 1 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/util/prosodyctl/check.lua	Sat Mar 05 16:06:39 2022 +0000
+++ b/util/prosodyctl/check.lua	Sat Mar 05 16:07:47 2022 +0000
@@ -1253,21 +1253,25 @@
 				print(("%d warnings:\n\n    "):format(#result.warnings));
 				print(table.concat(result.warnings, "\n    "));
 			end
+
+			if opts.verbose then
+				if result.external_ip then
+					print(("External IP: %s"):format(result.external_ip.address));
+				end
+				if result.relayed_addresses then
+					for i, relayed_address in ipairs(result.relayed_addresses) do
+						print(("Relayed address %d: %s:%d"):format(i, relayed_address.address, relayed_address.port));
+					end
+				end
+				if result.external_ip_pong then
+					print(("TURN external IP: %s"):format(result.external_ip_pong.address));
+				end
+			end
+
 			if result.error then
 				print("Error: "..result.error.."\n");
 				ok = false;
 			else
-				if opts.verbose then
-					print(("External IP: %s"):format(result.external_ip.address));
-					if result.relayed_addresses then
-						for i, relayed_address in ipairs(result.relayed_addresses) do
-							print(("Relayed address %d: %s:%d"):format(i, relayed_address.address, relayed_address.port));
-						end
-					end
-					if result.external_ip_pong then
-						print(("TURN external IP: %s"):format(result.external_ip_pong.address));
-					end
-				end
 				print("Success!\n");
 			end
 		end