#!/bin/sh

DOTA_DIR="/mnt/fsuser-1/dota"

# move to / dir

echo "Checking for updates in ${DOTA_DIR} ..."

cd /

if ! test -d $DOTA_DIR
then
  #echo "no dota dir"
  exit
fi

# gunzip all files if needed
for dota in $DOTA_DIR/*
do
	case $dota in
		*.tar.gz|*.tgz|*.tar)
			echo "Dota `basename $dota` detected, reboot in update mode"
			fw_setenv update 1
			reboot
			exit 0
			;;
	esac
done

