Commit a2759b45 authored by apapkovskiy's avatar apapkovskiy
Browse files

Added auto reprovisioning

parent 22b3d6de
......@@ -24,13 +24,43 @@ else
else
echo "File initialize.jcsh was NOT found."
fi
mkdir -p temp
cd temp
rm -f certs/cert_*.pem
rm -f certs/keyref_*.pem
rm -f certs/SampleConfig.json
$SNAP/jrcp/lib/nxp_iot_agent_demo
if [ -f $SNAP_COMMON/temp/certs/SampleConfig.json ]; then
echo "Got new configuration"
cd $SNAP_COMMON
rm -f certs/cert_*.pem
rm -f certs/keyref_*.pem
rm -f certs/SampleConfig.json
cp -r $SNAP_COMMON/temp/certs/* $SNAP_COMMON/certs
else
echo "A new configuration was NOT found."
fi
fi
if [ "$A71CH_DO_PROVISIONING" == "AUTO_PROVISIONING" ]; then
mkdir -p temp
cd temp
rm -f certs/cert_*.pem
rm -f certs/keyref_*.pem
rm -f certs/SampleConfig.json
$SNAP/jrcp/lib/nxp_iot_agent_demo
if [ -f $SNAP_COMMON/temp/certs/SampleConfig.json ]; then
echo "Got new configuration"
cd $SNAP_COMMON
rm -f certs/cert_*.pem
rm -f certs/keyref_*.pem
rm -f certs/SampleConfig.json
cp -r $SNAP_COMMON/temp/certs/* $SNAP_COMMON/certs
else
echo "A new configuration was NOT found."
fi
if [ ! -f $SNAP_COMMON/certs/SampleConfig.json ]; then
echo "File SampleConfig.json was NOT found. Run provisioning "
if [ -f ${SNAP_COMMON}/initialize.jcsh ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment