From 7dd5cb45216b724b62440fec4a90a8f2b1bdf32c Mon Sep 17 00:00:00 2001 From: Aaron Johnson Date: Sun, 15 Sep 2019 17:48:12 -0500 Subject: [PATCH] Added system utilities sanity check --- run.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/run.rb b/run.rb index eb0b253..b975458 100755 --- a/run.rb +++ b/run.rb @@ -32,6 +32,18 @@ admin = @conf['admin'] STDOUT.sync = true errcount = 0 puts "Checking if environment is sane...\n\n" +print "Checking system utilities ............... " +if !system("which nmap 2>&1 >/dev/null") + print "FAIL!\n\n".red.bold + puts "nmap".yellow.bold + " not found. This utility requires the 'nmap' command (for testing connectivity to temperature probes)" + exit(1) +elsif !system("which curl 2>&1 >/dev/null") + print "FAIL!\n\n".red.bold + puts "curl".yellow.bold + " not found. This utility requires the 'curl' command (for providing IP information to users upon request)" + exit(1) +else + print "OK\n".green.bold +end print "Checking bot token ...................... " if @token.nil? print "FAIL!\n\n".red.bold