Diff

plugins/mod_admin_telnet.lua @ 9868:0361e3379dd1

mod_admin_telnet: Show module status in module:list()
author Matthew Wild <mwild1@gmail.com>
date Tue, 19 Mar 2019 09:05:37 +0000
parent 9786:00f7af0be849
child 9974:c30933aa0242
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Tue Mar 19 09:05:15 2019 +0000
+++ b/plugins/mod_admin_telnet.lua	Tue Mar 19 09:05:37 2019 +0000
@@ -480,7 +480,12 @@
 			end
 		else
 			for _, name in ipairs(modules) do
-				print("    "..name);
+				local status, status_text = modulemanager.get_module(host, name).module:get_status();
+				local status_summary = "";
+				if status == "warn" or status == "error" then
+					status_summary = (" (%s: %s)"):format(status, status_text);
+				end
+				print(("    %s%s"):format(name, status_summary));
 			end
 		end
 	end