# HG changeset patch # User Vadim Misbakh-Soloviov # Date 1370602485 -25200 # Node ID b307b72ae52737b405299162937ab6a35a716948 # Parent 3dd909e87143d483d1c4f9ace33d0e6e991cc16f mod_listusers: fixed banner skipping cycle diff -r 3dd909e87143 -r b307b72ae527 mod_listusers/mod_listusers.lua --- a/mod_listusers/mod_listusers.lua Fri Jun 07 08:43:03 2013 +0700 +++ b/mod_listusers/mod_listusers.lua Fri Jun 07 17:54:45 2013 +0700 @@ -43,6 +43,21 @@ local st, conn = pcall(assert,socket.connect(console_interfaces[1], console_ports[1])); if (not st) then print("Error"..(conn and ": "..conn or "")); return 1; end + local banner = config.get("*", "console_banner"); + if ( + (not banner) or + ( + (type(banner) == "string") and + (banner:match("^| (.+)$")) + ) + ) then + repeat + local rec_banner = conn:receive() + until + rec_banner == "" or + rec_banner == nil; -- skip banner + end + conn:send("c2s:show()\n"); conn:settimeout(1); -- Only hit in case of failure