moved status to commands.rb

pull/2/head
Aaron Johnson 7 years ago
parent fd134708fe
commit e366377175

@ -59,3 +59,13 @@ def process_command_srvstop(message, command, adm)
end
end
def process_command_srvstatus(message, command, adm)
if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm)
telnet = @conf['telnet']
reply = `./scripts/srvstatus #{telnet['host']} #{telnet['port']} #{telnet['pass']}`
else
reply = "Refusal: I am not authorized to provide this information here."
end
return reply
end

@ -99,12 +99,12 @@ def handle_message(message)
when '/srvstop'
reply = process_command_srvstop(message, command, adm)
when '/status'
#reply = process_command_srvstatus(message, command, adm)
if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm)
reply = `./scripts/srvstatus #{telnet['host']} #{telnet['port']} #{telnet['pass']}`
else
reply = "Refusal: I am not authorized to provide this information here."
end
reply = process_command_srvstatus(message, command, adm)
#if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm)
# reply = `./scripts/srvstatus #{telnet['host']} #{telnet['port']} #{telnet['pass']}`
#else
# reply = "Refusal: I am not authorized to provide this information here."
#end
when '/location', '/whereareyou'
if message_from_admin?(message, adm) || is_chat_authorized?(message, @auth_chat)
reply = "I am currently located at:\n\nHost: #{`echo $HOSTNAME`}ExtIP: #{`curl myip.contegix.com 2>/dev/null`}"

Loading…
Cancel
Save