Skip to content

Instantly share code, notes, and snippets.

@claytantor
Created March 8, 2019 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claytantor/c48477832e6e8e620ee35e70b99216e8 to your computer and use it in GitHub Desktop.
Save claytantor/c48477832e6e8e620ee35e70b99216e8 to your computer and use it in GitHub Desktop.
bootstrap
#!/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