2021-06-01 18:18:46 +00:00
|
|
|
#!/usr/bin/expect
|
|
|
|
|
|
|
|
set passwd [lindex $argv 0]
|
|
|
|
set args [lrange $argv 1 end]
|
|
|
|
|
|
|
|
spawn -noecho {*}$args
|
|
|
|
expect -re {^.*assword.*$}
|
|
|
|
|
|
|
|
if { $passwd == "-"} {
|
|
|
|
send -- "\r"
|
|
|
|
} else {
|
|
|
|
send -- "$passwd\r"
|
|
|
|
}
|
|
|
|
|
2021-10-14 11:01:55 +00:00
|
|
|
expect {
|
|
|
|
"Relay transaction" {
|
|
|
|
send "y\r"
|
|
|
|
exp_continue
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
}
|
2021-06-01 18:18:46 +00:00
|
|
|
lassign [wait] pid spawnid os_error_flag value
|
|
|
|
exit $value
|