diff --git a/autoupdate.sh b/autoupdate.sh
index d19449c046f445b33dacd849e44ba985cdcf19fb..aa28ed039dae2002c55a7650b3a8dbeecd89b92b 100755
--- a/autoupdate.sh
+++ b/autoupdate.sh
@@ -2,6 +2,8 @@
 
 # do a git pull and reboot or restart script if anything changed
 
+cd /home/pi/traincam
+
 res=$(git pull)
 
 #echo $res
@@ -11,5 +13,5 @@ if [[ $res = *"up-to-date"* ]]; then
   echo "It's up to date !"
 else
   echo "We'll have to restart !"
-
+  sudo reboot
 fi