From c5063e493304f377a581c094962066bd5c569bce Mon Sep 17 00:00:00 2001 From: Aaron Johnson Date: Sun, 25 Aug 2019 21:13:36 -0500 Subject: [PATCH] Fixed probe check position --- run.rb | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/run.rb b/run.rb index 57a64af..e2a8709 100755 --- a/run.rb +++ b/run.rb @@ -99,12 +99,7 @@ if @auth_chat.nil? else print "OK\n".green.bold end -puts "Errors found: #{errcount.to_s}\n\n" -if errcount > 0 - print "Environment is grinning and holding a spatula. Please review your configuration.\n\n".red.bold -else - print "Environment appears sane.\n\n".green.bold -end +print "Checking probes list .................... " if @probes.nil? errcount += 1 print "FAIL!\n\n".red.bold @@ -112,6 +107,12 @@ if @probes.nil? else print "OK\n".green.bold end +puts "Errors found: #{errcount.to_s}\n\n" +if errcount > 0 + print "Environment is grinning and holding a spatula. Please review your configuration.\n\n".red.bold +else + print "Environment appears sane.\n\n".green.bold +end STDOUT.sync = false ### End sanity check ### @@ -158,6 +159,17 @@ def handle_message(message) #Format command command = message.text.split(" ")[0].split("@")[0].downcase #Strip command from arguments and @tags + ## Constant collection model (may be scrapped) + #last_collection = 0 + #loop do + # collection_time = Time.now + # if collection_time - last_collection >= 10 + # puts timestamp + ": [#{collection_time}] Updating records //Not really" + # last_collection = collection_time + # STDOUT.flush + # end + #end + reply = 'Empty String' adm = @conf['admin'] puts Time.now.strftime("%F %H:%M:%S").yellow + ": Received command from " + "#{message.from.username}".cyan.bold + " [" + "#{message.from.id}".cyan + "]: " + "#{command}".magenta.bold