Hack for remotely bouncing ZyXEL modem EQ-660R
Posted by
krizzyla
|
Subscribe to:
Post Comments (Atom)
#!/usr/bin/ruby1.8 require 'rubygems' require 'net/ping' require 'open4' # Another idea is to use `ip route` and grep default. # If the default ISP route is missing or cannot be pinged # then the modem should be reset. Net::Ping::TCP.service_check = false # seems to have no effect for TCP p = Net::Ping::TCP.new('208.75.86.204', 80) unless p.ping? or p.ping? or p.ping? # debugging puts `ip route` puts `/sbin/ifconfig eth0` status = Open4::popen4("/bin/netcat -q0 192.168.2.1 23") do |pid, stdin, stdout, stderr| # Magic sequence to restart device stdin.puts "passwd" stdin.puts "24" stdin.puts "4" stdin.puts "21" stdin.close end
Copyright © 2008 Krizzyla | Design by Smashing Wordpress Themes - Blogspot template by Zona Chrome
0 comments:
Post a Comment