#!/bin/sh

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

echo "Copying templates to ${DEST_DIR}..."
cp -r $THIS_DIR/templates/* $DEST_DIR

# 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 "Done."
