# Thomas Bräunl, UWA 2017
echo Updating EyeBot Software for Raspberry Pi
cd $HOME

# Web download
wget http://robotics.ee.uwa.edu.au/rasp/eyebot/10-Buster/latest.tgz || exit

# preserving old hdt file
cp eyebot/bin/hdt.txt .

DATE=`date +%Y-%m-%d`
mv eyebot eyebot-$DATE
tar xfz latest.tgz
rm latest.tgz

# restore hdt file
mv -f hdt.txt eyebot/bin/

echo Update Complete!

# delete and restart EyeBot process
pkill EyeBot
EyeBot&
