forked from tdulcet/Distributed-Computing-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mprime.exp
36 lines (34 loc) · 860 Bytes
/
mprime.exp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/expect -f
# Teal Dulcet
# ./mprime.exp <User ID> <Computer name> <Type of work>
set timeout -1
set USERID [lindex $argv 0]
set COMPUTER [lindex $argv 1]
set TYPE [lindex $argv 2]
spawn ./mprime -m
expect "Join Gimps? (*):"
sleep 1
send -- "y\r"
expect "Use PrimeNet to get work and report results (*):"
sleep 1
send -- "y\r"
expect "Your user ID or \"ANONYMOUS\" (*):"
sleep 1
send -- "$USERID\r"
expect "Optional computer name:"
sleep 1
send -- "$COMPUTER\r"
expect {
"Type of work to get (*):" { sleep 1; send -- "$TYPE\r"; exp_continue }
"Your choice:" { }
"Use the following values to select a work type:" { exp_continue }
"*: 1" { exp_continue }
" (*):" { sleep 1; send -- "\r"; exp_continue }
}
expect "Done communicating with server."
send \x03
sleep 10
expect "Choose Test/Continue to restart."
sleep 1
send -- "5\r"
expect eof