diff --git a/commands.rb b/commands.rb index 918a9cc..ee7dfaf 100644 --- a/commands.rb +++ b/commands.rb @@ -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 + diff --git a/run.rb b/run.rb index 99a2ee7..a43ed15 100755 --- a/run.rb +++ b/run.rb @@ -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`}"