Code Review
/
bottlenecks.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
35600065fbf51468537bca9abdc8b37a72df0ec7
[bottlenecks.git]
/
utils
/
infra_setup
/
heat_template
/
vstf_heat_template
/
ssh.sh
1
function run_cmd()
2
{
3
local ip=$1
4
local usr=$2
5
local passwd=$3
6
local cmd=$4
7
expect -c "
8
spawn ssh $usr@$ip
9
set timeout -1
10
expect {
11
\"*no)?\" {
12
send \"yes\r\"
13
exp_continue
14
}
15
\"*assword:*\" {
16
send \"$passwd\r\"
17
exp_continue
18
}
19
\"*#\" {
20
send \"$cmd\r\"
21
exec sleep 1
22
send \"exit\r\"
23
expect eof
24
}
25
}
26
"
27
}
28