Added check to /srvstop to make sure server is up before sending stop command

dev
Aaron Johnon 2 years ago
parent 8d0d765fd7
commit 75c79750d4

@ -125,8 +125,18 @@ def process_command_srvstop(message, command, adm)
return "Refusal: Although I respect your wishes, master, I am not authorized to perform this function for this group." return "Refusal: Although I respect your wishes, master, I am not authorized to perform this function for this group."
else else
telnet = @conf['telnet'] telnet = @conf['telnet']
`./scripts/srvstop #{telnet['host']} #{telnet['port']} #{telnet['pass']}` print 'Checking connectivity to Empyrion service... '
return "Affirmation: I am shutting down the Empyrion service." STDOUT.flush
if system("nc -zvw3 #{telnet['host']} #{telnet['port']} >/dev/null 2>&1")
print "OK\n".green.bold + "Sending shutdown message:\n"
STDOUT.flush
reply = "Affirmation: I am shutting down the Empyrion service."
`./scripts/srvstop #{telnet['host']} #{telnet['port']} #{telnet['pass']}`
else
print "Server did not respond!\nSending failure message...\n".red.bold
reply = "Exclamation: Server is not responding!"
end
return reply
end end
end end

@ -1,6 +1,12 @@
SkyfallTech EGS Telebot SkyfallTech EGS Telebot
Patch Notes: Patch Notes:
v0.5.01
+ Added check to /srvstop to see if the server is even running first
* (Previously reported a successful shutdown even if the there was nothing running)
+ Added common aliases for /status command
+ Added an Easter egg command
v0.5.00 v0.5.00
+ Added Voicechat information feature (/voice). + Added Voicechat information feature (/voice).
+ Rewrite of message handling based on Skyfall Heatbot. + Rewrite of message handling based on Skyfall Heatbot.

Loading…
Cancel
Save