#!/bin/bash
cd /home/pi/extremefeedbacklamp
git remote update
DELTAPRE=$(git rev-list HEAD...origin/master --count)
git reset --hard origin/master
DELTAPOST=$(git rev-list HEAD...origin/master --count)
if [ "$DELTAPRE" != "$DELTAPOST" ]
then
    echo "update found and applied succesfully, rebooting"
    sudo cp -f /home/pi/extremefeedbacklamp/xfdlampupdate.sh /etc/cron.daily/xfdlampupdate
    sudo chmod +x /etc/cron.daily/xfdlampupdate
    #sudo cp -f /home/pi/extremefeedbacklamp/xfdlampupdate.sh /etc/cron.hourly/xfdlampupdate
    #sudo chmod +x /etc/cron.hourly/xfdlampupdate
    sudo shutdown -r now
fi

#!/bin/bash
cd /home/pi/extremefeedbacklamp
git remote update
DELTAPRE=$(git rev-list HEAD...origin/master --count)
git reset --hard origin/master
DELTAPOST=$(git rev-list HEAD...origin/master --count)
if [ "$DELTAPRE" != "$DELTAPOST" ]
then
    echo "update found and applied succesfully, rebooting"
    sudo cp -f /home/pi/extremefeedbacklamp/xfdlampupdate.sh /etc/cron.daily/xfdlampupdate
    sudo chmod +x /etc/cron.daily/xfdlampupdate
    sudo chown -R pi:pi /home/pi/extremefeedbacklamp
    #sudo cp -f /home/pi/extremefeedbacklamp/xfdlampupdate.sh /etc/cron.hourly/xfdlampupdate
    #sudo chmod +x /etc/cron.hourly/xfdlampupdate
    sudo shutdown -r now
fi

Change owner for extremefeedbacklamp dir after updating
Change owner for extremefeedbacklamp dir after updating

Change-Id: Ie690982895a8f53f50b956da54401f4fc5ff60fa
Signed-off-by: Aske Olsson <d505c9f7bdc4614812e0c067a110b9579be0b041@switch-gears.dk>
