UNPKG

534 Bapplication/x-shView Raw
1#!/usr/bin/expect
2
3set cdbPath [lindex $argv 0]
4set cdbDevice [lindex $argv 1]
5set sopFilename [lindex $argv 2]
6
7set timeout 1000
8
9spawn $cdbPath -s $cdbDevice shell
10expect {
11 "developer@" {
12 send "exit\r"
13 spawn $cdbPath -s $cdbDevice shell "/usr/bin/ins-tool -siu /tmp/$sopFilename && rm -f /tmp/$sopFilename"
14 }
15 "root@" {
16 send "su install\r"
17 expect "install@" {
18 send "/usr/bin/ins-tool -siu /tmp/$sopFilename && exit\r"
19 expect "root@" {send "rm -f /tmp/$sopFilename && exit\r"}
20 }
21 }
22}
23expect eof
\No newline at end of file