-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.sh
More file actions
executable file
·44 lines (34 loc) · 816 Bytes
/
demo.sh
File metadata and controls
executable file
·44 lines (34 loc) · 816 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
export CUST_DSN="./demo.sqlite"
export CUST_USER="james"
echo "dsn=$CUST_DSN, user=$CUST_USER"
# start server and track pid to send shutdown signal
./custody serve &
SRVPID=$!
./custody create
#--username "$CUST_USER"
function sign() {
msg="$1"
echo "$msg" | ./custody sign
}
function list() {
./custody list --username "$CUST_USER"
}
# sign some messages
sign "Hello World"
sign "upload screenshot.png"
sign "enhance screenshot.png"
sign "run 'facedetections' on screenshot.png"
sign "print screenshot.png"
sign "submit screenshot.png to court"
export CUST_JSON=1
# list the messages we just signed
list
#send shutdown signal
echo "Shutting down server..."
kill ${SRVPID}
wait
echo "Server stopped"
echo "To clean up the database remove $CUST_DSN"
exit 0