This repository was archived by the owner on Dec 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.sh
More file actions
23 lines (20 loc) · 1.24 KB
/
client.sh
File metadata and controls
23 lines (20 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# stop script on error
set -e
# Check to see if root CA file exists, download if not
if [ ! -f ./root-CA.crt ]; then
printf "\nDownloading AWS IoT Root CA certificate from Symantec...\n"
curl https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem > root-CA.crt
fi
# install AWS Device SDK for Python if not already installed
if [ ! -d ./aws-iot-device-sdk-python ]; then
printf "\nInstalling AWS SDK...\n"
git clone https://github.com/aws/aws-iot-device-sdk-python.git
pushd aws-iot-device-sdk-python
python setup.py install
popd
fi
# run pub/sub sample app using certificates downloaded in package
printf "\nRunning pub/sub sample application...\n"
#python ./aws-iot-device-sdk-python/samples/basicPubSub/basicPubSub.py -e a3gdt5tgf4fwdv.iot.ap-northeast-2.amazonaws.com -r root-CA.crt -c bongjafeed.cert.pem -k bongjafeed.private.key
python ./client.py -n bongjafeed -t bongjafeed/+/+ -e a3gdt5tgf4fwdv.iot.ap-northeast-2.amazonaws.com -r root-CA.crt -c bongjafeed.cert.pem -k bongjafeed.private.key
#python ./ThingShadowEcho.py -n bongjafeed -t bongjafeed/+/+ -e a3gdt5tgf4fwdv.iot.ap-northeast-2.amazonaws.com -r root-CA.crt -c bongjafeed.cert.pem -k bongjafeed.private.key