You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
671 B
35 lines
671 B
12 months ago
|
#!/usr/bin/expect -d
|
||
|
# Author: Iain Douglas <centos@1n6.org.uk>
|
||
|
|
||
|
set timeout 10
|
||
|
match_max 6000
|
||
|
spawn su passtest -c passwd
|
||
|
expect -re "(UNIX|Current) password:" { send -- "passtest\r" }
|
||
|
expect {
|
||
|
"You must wait longer to change your password"
|
||
|
{
|
||
|
exit 2
|
||
|
}
|
||
|
"Authentication token manipulation error"
|
||
|
{
|
||
|
exit 3
|
||
|
}
|
||
|
"Current Password:" {
|
||
|
send -- "passtest\r"
|
||
|
expect {
|
||
|
"Authentication token manipulation error"
|
||
|
{
|
||
|
exit 3
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
"password:"
|
||
|
{
|
||
|
send -- "ano24ther\r"
|
||
|
expect "*?\[pP]assword:*"
|
||
|
send -- "ano24ther\r"
|
||
|
expect eof
|
||
|
}
|
||
|
}
|
||
|
|