#!/usr/bin/expect -f

# script to log on to a BeBox router [ST Speedtouch 780] and gather line stats

# set timeout for response from router to 30 seconds
set timeout 30
set router "host.or.ip.of.router"
set port "23"
set username "Administrator"
set password "routerpassword"

# telnet to $router on $port
spawn telnet $router $port

expect "Username :"
send "$username\r"

expect "Password :"
send "$password\r"

expect "}=>"
send "adsl info\r"

expect "}=>"
send "exit\r"
