-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
copy-certs.sh
executable file
·48 lines (43 loc) · 1.43 KB
/
copy-certs.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
#!/bin/bash
#
# epaper-idf
#
# Copyright (c) 2021 Jeremy Carter <[email protected]>
#
# This code is released under the license terms contained in the
# file named LICENSE, which is found in the top-level folder in
# this project. You must agree to follow those license terms,
# otherwise you aren't allowed to copy, distribute, or use any
# part of this project in any way.
epaper_idf_copy_certs() {
BUILD_DIR=${BUILD_DIR:-"build/"}
CERT_DIR=${CERT_DIR:-"certs/"}
if [ ! -f "ca_cert.pem" ] || [ ! -f "ca_key.pem" ]; then
echo "error: You haven't created these certificate files yet: ./ca_cert.pem, ca_key.pem"
echo ""
echo "Run the following script first to generate the certificates:"
echo ""
echo "./gen-certs.sh"
echo ""
return 1
fi
if [ ! -f "dhparam.pem" ]; then
echo "error: You haven't created the dhparam file yet: ./dhparam.pem"
echo ""
echo "Run the following script first to generate the file (it might take a long time):"
echo ""
echo "./gen-dhparam.sh"
echo ""
return 2
fi
scp ca_cert.pem "$@"
scp ca_key.pem "$@"
scp dhparam.pem "$@"
scp ca_cert.pem "$@"/$BUILD_DIR
scp ca_key.pem "$@"/$BUILD_DIR
scp dhparam.pem "$@"/$BUILD_DIR
scp ca_cert.pem "$@"/$CERT_DIR
# scp ca_cert_conf.pem "$@"/$CERT_DIR
# scp ca_key_conf.pem "$@"/$CERT_DIR
}
epaper_idf_copy_certs $@