This commit is contained in:
2023-10-19 17:58:58 +08:00
parent 9f34f2be2d
commit c0817b1b90

View File

@@ -13,7 +13,13 @@ while read line
for toolname in $toollist;do
expect <<EOF
set timeout 10
spawn "scp $tooldir/$toolname $user@$ip:/tmp && ssh $user@$ip sudo cp /tmp/$toolname $tooldir"
spawn scp $tooldir/$toolname $user@$ip:/tmp
expect {
"yes/no" { send "yes\n";exp_continue }
"password" { send "$passwd\n" }
}
expect "password" { send "$passwd\n" }
spawn ssh $user@$ip sudo mv /tmp/$toolname $tooldir
expect {
"yes/no" { send "yes\n";exp_continue }
"password" { send "$passwd\n" }