-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathtest.sh
51 lines (39 loc) · 1.35 KB
/
test.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -x
set -e
# Configure to the IP address of the container
REPL=172.24.0.2:4001
AGENT=172.24.0.3:5001
# Configure the API keys from host.env
curl -X POST -H "Content-Type: text/plain" --data-binary @host.env http://$AGENT/configure
curl http://$AGENT/status
# Configure the API keys
curl -X POST -H "Content-Type: text/plain" --data-binary @host.env http://$REPL/configure
curl http://$REPL/status
# Bootstrap credentials
# curl -X POST http://$AGENT/bootstrap
# curl http://$AGENT/status
# Refresh credentials
# curl -X POST http://$AGENT/refresh
# curl http://$AGENT/status
# Load private data
curl -X POST http://$AGENT/load
curl http://$AGENT/status
# Save private data (not needed after refresh)
# curl -X POST http://$AGENT/save
# curl http://$AGENT/status
# Request the key
curl -s -X POST http://$REPL/requestKey > request.out
PUBK=$(cat request.out | jq -r .pubk)
QUOTE=$(cat request.out | jq -r .quote)
# Prepare the encrypted state file
# curl -s -X POST -d "pubk=$PUBK" -d "quote=$QUOTE" http://$REPL/onboard > onboard.out
# Post the encrypted state file
#curl -X POST -H "Content-Type: text/plain" --data-binary @onboard.out http://$REPL/receiveKey
#curl http://$REPL/status
# Load private data
# curl -X POST http://$AGENT/load
# curl http://$AGENT/status
# Run the Bot
# curl -X POST http://$AGENT/start_bot
# curl http://$AGENT/status