#!/usr/bin/expect -f
set address "192.168.x.x"
set port "8023"
spawn telnet $address $port
expect "Escape character is '^]'." {
sleep 1
send "root¥r"
}
expect "Password" {
sleep 1
send "lightmpd¥r"
}
expect "#" {
sleep 1
send "mount /dev/sda1 /tmp ; df ; cd /tmp ; ls -l¥r"
}
expect "#" {
sleep 1
interact
exit 0
}
expect eof
Comments