Created
March 8, 2019 21:44
-
-
Save claytantor/c48477832e6e8e620ee35e70b99216e8 to your computer and use it in GitHub Desktop.
bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# stop script on error | |
set -e | |
THING_NAME=$1 | |
THING_ENDPOINT=$2 | |
python3 -m venv venv --system-site-packages | |
if [ $(python3 openssl.py) == "true" ] | |
then | |
echo OpenSSL is enabled. | |
curl https://bootstrap.pypa.io/get-pip.py | ./venv/bin/python | |
./venv/bin/pip install -r requirements.txt | |
echo "thing name: ${THING_NAME} thing endpoint: ${THING_ENDPOINT}" | |
./venv/bin/python bootstrap.py -e ${THING_ENDPOINT} -r ../root-ca-cert.pem -c ../${THING_NAME}-certificate.pem -k ../${THING_NAME}-keypair-private.pem -m subscribe -t bootstrap | |
else | |
echo ERROR: OpenSSL is required fro IOT TLS. | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment