net/telnet session times out

W

Wybo Dekker

I'm trying to run a telnet session with my adsl modem with

#!/usr/bin/env ruby

require 'net/telnet'

tn = Net::Telnet.new("Host" => "10.0.0.138",
"Timeout" => 5,
"Prompt" => /[$%#>] \z/n
)
tn.login("wybo", "my_password") { |c| print c }
tn.cmd("help") { |c| print c }
tn.close

But it just times out:

$ tn
/usr/local/lib/ruby/1.8/net/telnet.rb:551:in `waitfor': timed out while
waiting for more data (Timeout::Error)
from /usr/local/lib/ruby/1.8/net/telnet.rb:719:in `login'
from ./tn:9
$

What can be wrong with my script?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top