aboutsummaryrefslogtreecommitdiffstats
path: root/compass/deploy/remote_excute.exp
blob: 9dd112b31933c2e5e38cd72f76ab1c0c5a8f2252 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/expect

set command [lindex $argv 0]
set passwd [lindex $argv 1]

eval spawn "$command"
set timeout 60

expect {
    -re ".*es.*o.*"
    {
        exp_send "yes\r"
        exp_continue
    }

    -re ".*sword:" {
        exp_send "$passwd\r"

    }

}

interact