# # Cerberus P 6311-07A restart script # written in 2009 by antonone # # Visit http://anadoxin.org/blog # require 'net/http' require 'base64' def main login = "admin" pass = "password" b64_auth = Base64.encode64("%s:%s" % [ login, pass ]) path = '/Forms/tools_system_1' headers = { "User-Agent" => "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.4) Gecko/2008111318 Linux Mint/5 (Elyssa) Firefox/3.0.4", "Accept" => "text/html", "Accept-Charset" => "ISO-8859-2", "Connection" => "close", "Referer" => "http://192.168.1.100/navigation-maintenance.html", "Authorization" => ("Basic %s" % b64_auth) } http = Net::HTTP.new "192.168.1.100", 80 res = http.request_post path, "restoreFlag=0&Restart=RESTART", headers puts res return res.code == '200' end main