This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nms-oam/gloam/conf/collector/expect_ssh

17 lines
314 B
Plaintext
Raw Normal View History

#!/usr/bin/expect
set timeout 3600
set host [lindex $argv 0]
set username [lindex $argv 1]
set password [lindex $argv 2]
set command [lindex $argv 3]
spawn ssh $username@$host $command
expect {
"(yes/no)?" {
send "yes\n"
expect "*assword:" { send "$password\n"}
}
"*assword:" { send "$password\n" }
}