frostfs-dev-env/bin/passwd.exp
Evgenii Stratonikov 795c64985f [#135] .env: update neo-go version
Update `bin/passwd.exp` to handle commands with and without prompt.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-20 17:45:59 +03:00

23 lines
349 B
Text
Executable file

#!/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"
}
expect {
"Relay transaction" {
send "y\r"
exp_continue
}
EOF
}
lassign [wait] pid spawnid os_error_flag value
exit $value