This repository has been archived on 2024-08-27. You can view files and clone it, but cannot push or open issues or pull requests.
redstoner.com/app/controllers/status_controller.rb
2013-10-07 04:59:21 +02:00

21 lines
781 B
Ruby

class StatusController < ApplicationController
def show
if params[:check]
if params[:check].downcase == "minecraft"
if port_open?("redstoner.com", 25565)
send_file "app/assets/images/on.png", :type => "image/png", :disposition => "inline"
else
send_file "app/assets/images/off.png", :type => "image/png", :disposition => "inline"
end
elsif params[:check].downcase == "teamspeak"
if port_open?("redstoner.com", 9987)
send_file "app/assets/images/on.png", :type => "image/png", :disposition => "inline"
else
send_file "app/assets/images/off.png", :type => "image/png", :disposition => "inline"
end
else
render :text => "invalid params"
end
end
end
end