Added system utilities sanity check

pull/2/head
Aaron Johnson 6 years ago
parent d3bb25758b
commit 7dd5cb4521

@ -32,6 +32,18 @@ admin = @conf['admin']
STDOUT.sync = true STDOUT.sync = true
errcount = 0 errcount = 0
puts "Checking if environment is sane...\n\n" 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 ...................... " print "Checking bot token ...................... "
if @token.nil? if @token.nil?
print "FAIL!\n\n".red.bold print "FAIL!\n\n".red.bold

Loading…
Cancel
Save