#!/bin/sh

THIS_DIR=`dirname $0`
DEST_DIR=`pwd`

# Copy the start script template, and add a unique DEVICE_KEY.
DEVICE_KEY=`date +%s`
START_SH=$DEST_DIR/faas_demo_start.sh
echo "Creating ${START_SH}..."
sed -e 's/{{DEVICE_KEY}}/'$DEVICE_KEY'/' $THIS_DIR/templates/faas_demo_start.sh > $START_SH
chmod +x $START_SH

echo "Creating ${DEST_DIR}/faas_demo_apis..."
cp -r $THIS_DIR/templates/faas_demo_apis $DEST_DIR

echo "Done."
