Comparison

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
comparison
equal deleted inserted replaced
7908:dbdaa8487ecd 7911:e528d848a185
1128 print("HTTP requests to unknown hosts will be handled by "..default_host); 1128 print("HTTP requests to unknown hosts will be handled by "..default_host);
1129 end 1129 end
1130 return true; 1130 return true;
1131 end 1131 end
1132 1132
1133 module:hook("server-stopping", function(event)
1134 for conn, session in pairs(sessions) do
1135 session.print("Shutting down: "..(event.reason or "unknown reason"));
1136 end
1137 end);
1138
1133 ------------- 1139 -------------
1134 1140
1135 function printbanner(session) 1141 function printbanner(session)
1136 local option = module:get_option_string("console_banner", "full"); 1142 local option = module:get_option_string("console_banner", "full");
1137 if option == "full" or option == "graphic" then 1143 if option == "full" or option == "graphic" then