Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 10 lines (9 sloc) 235 Bytes
#!/usr/bin/expect
spawn telnet 192.168.1.1
expect "Login: " { send "admin\n" }
expect "Password: " { send "admin\n" }
sleep 1
send "\n"
expect "> " { send "ping google.com || reboot\n" }
expect "> " { send "logout\n" }
expect eof