Fixed 'server is up oops nevermind' condition

pull/10/head
Aaron Johnson 6 years ago
parent 61f587a85e
commit 658c3df819

@ -73,7 +73,7 @@ def process_command_srvstatus(message, command, adm)
telnet = @conf['telnet'] telnet = @conf['telnet']
print 'Checking connectivity to Empyrion service... ' print 'Checking connectivity to Empyrion service... '
STDOUT.flush STDOUT.flush
if `nc -zvw3 #{telnet['host']} #{telnet['port']} >/dev/null 2>&1` if system("nc -zvw3 #{telnet['host']} #{telnet['port']} >/dev/null 2>&1")
print "Server responded!\nSending message receipt... " print "Server responded!\nSending message receipt... "
STDOUT.flush STDOUT.flush
if `./scripts/srvstatus.receipt #{@conf['token']} #{message.chat.id}` if `./scripts/srvstatus.receipt #{@conf['token']} #{message.chat.id}`
@ -81,11 +81,12 @@ def process_command_srvstatus(message, command, adm)
else else
print "Receipt FAILED to send (non-zero exit code on scripts/srvstatus.receipt) !!!\nContinuing to fetch details anyway...\n" print "Receipt FAILED to send (non-zero exit code on scripts/srvstatus.receipt) !!!\nContinuing to fetch details anyway...\n"
end end
reply = `./scripts/srvstatus #{telnet['host']} #{telnet['port']} #{telnet['pass']}`
else else
print "Server did not respond! Passing to scripts/srvstatus for sending the failure message (revisit this for code efficiency review\n)" print "Server did not respond!\nSending failure message...\n"
reply = "Server is not responding!"
end end
STDOUT.flush STDOUT.flush
reply = `./scripts/srvstatus #{telnet['host']} #{telnet['port']} #{telnet['pass']}`
else else
reply = "Refusal: I am not authorized to provide this information here." reply = "Refusal: I am not authorized to provide this information here."
end end

Loading…
Cancel
Save