2014-09-18 01:12:55 +05:30
|
|
|
#!/usr/bin/expect
|
|
|
|
|
|
|
|
set timeout 5
|
2023-02-08 08:42:59 +05:30
|
|
|
expect_after default {puts stderr "\nFAIL"; exit 1}
|
2014-09-18 01:12:55 +05:30
|
|
|
|
|
|
|
spawn /bin/bash
|
|
|
|
expect "# "
|
|
|
|
|
|
|
|
send "login foo\r"
|
|
|
|
expect "Password: "
|
|
|
|
sleep 0.1
|
|
|
|
send "badpass\r"
|
|
|
|
send_user "\n# password 'badpass' sent\n\n"
|
|
|
|
expect "login: "
|
|
|
|
|
|
|
|
send "exit\r"
|
|
|
|
exit 0
|