Diff

plugins/mod_admin_telnet.lua @ 7911:e528d848a185

mod_admin_telnet: Print a message to open sessions when shutting down, including the reason
author Kim Alvefur <zash@zash.se>
date Tue, 21 Feb 2017 17:34:01 +0100
parent 7722:82333dfdfaff
child 7923:81f3068fc30c
child 7977:01d6298de991
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Mon Feb 20 01:26:48 2017 +0100
+++ b/plugins/mod_admin_telnet.lua	Tue Feb 21 17:34:01 2017 +0100
@@ -1130,6 +1130,12 @@
 	return true;
 end
 
+module:hook("server-stopping", function(event)
+	for conn, session in pairs(sessions) do
+		session.print("Shutting down: "..(event.reason or "unknown reason"));
+	end
+end);
+
 -------------
 
 function printbanner(session)