forked from icpc-environment/icpc-env
-
Notifications
You must be signed in to change notification settings - Fork 2
/
fetch-secrets.sh
29 lines (23 loc) · 972 Bytes
/
fetch-secrets.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
#!/bin/bash
set -euo pipefail
usage() {
echo "usage: fetch-secrets.sh <contestid>"
exit 1
}
[ $# -eq 1 ] || usage
mkdir -p files/secrets
# copy jumpy public key
cp secrets/$1/[email protected] files/secrets/
# copy jumpy user private key + ca certificate signature
cp secrets/$1/jumpy@icpc{,-cert.pub} files/secrets/
# copy icpcadmin@contestmanager public key
cp secrets/$1/[email protected] files/secrets/
# and private key + ca certificate signature
cp secrets/$1/icpcadmin@contestmanager{,-cert.pub} files/secrets/
# copy public+private host key for the contestant machines (and ca certificate signature)
cp secrets/$1/contestant.icpcnet.internal_host_ed25519_key{,.pub,-cert.pub} files/secrets/
# copy public+private host key for the management machine (and ca certificate signature)
cp secrets/$1/contestmanager.icpcnet.internal_host_ed25519_key{,.pub,-cert.pub} files/secrets/
# copy public ca
cp secrets/$1/server_ca.pub files/secrets/
echo "done!"