#!/bin/bash
#
# HVAC ready shell
#

#Assign permissions
chmod +x /home/root/edge/dog/download/hvac/EdgeHVAC.jar
chmod +x /home/root/edge/dog/download/hvac/start.sh
chmod +x /home/root/edge/dog/download/hvac/stop.sh

#Copy file
if [ ! -d "/home/root/edge/hvac/" ];then
    mkdir /home/root/edge/hvac
fi
if [ -e "/home/root/edge/hvac/EdgeHVAC.jar" ];then
    rm -f /home/root/edge/hvac/EdgeHVAC.jar
fi
if [ -e "/home/root/edge/hvac/baseconfig.json" ];then
    rm -f /home/root/edge/hvac/baseconfig.json
fi
if [ -e "/home/root/edge/hvac/start.sh" ];then
    rm -f /home/root/edge/hvac/start.sh
fi
if [ -e "/home/root/edge/hvac/stop.sh" ];then
    rm -f /home/root/edge/hvac/stop.sh
fi
cp -i /home/root/edge/dog/download/hvac/EdgeHVAC.jar /home/root/edge/hvac
cp -i /home/root/edge/dog/baseconfig.json /home/root/edge/hvac
cp -i /home/root/edge/dog/download/hvac/start.sh /home/root/edge/hvac
cp -i /home/root/edge/dog/download/hvac/stop.sh /home/root/edge/hvac


