#!/bin/bash

# do a git pull and reboot or restart script if anything changed

cd /home/pi/traincam

res=$(git pull)

#echo $res
ok="up-to-date"

if [[ $res = *"up-to-date"* ]]; then
  echo "It's up to date !"
else
  echo "We'll have to restart !"
  sudo reboot
fi