2018-01-02 18:26:37 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-05-22 10:44:25 +01:00
|
|
|
./build.sh
|
2018-01-02 18:26:37 +00:00
|
|
|
|
|
|
|
# Generate the keys if they don't already exist.
|
|
|
|
if [ ! -f server.key ] || [ ! -f server.crt ] || [ ! -f matrix_key.pem ]; then
|
|
|
|
echo "Generating keys ..."
|
|
|
|
|
|
|
|
rm -f server.key server.crt matrix_key.pem
|
|
|
|
|
|
|
|
test -f server.key || openssl req -x509 -newkey rsa:4096 \
|
|
|
|
-keyout server.key \
|
|
|
|
-out server.crt \
|
|
|
|
-days 3650 -nodes \
|
2019-05-22 10:44:25 +01:00
|
|
|
-subj /CN=localhost
|
2018-01-02 18:26:37 +00:00
|
|
|
|
|
|
|
test -f matrix_key.pem || /build/bin/generate-keys -private-key matrix_key.pem
|
|
|
|
fi
|