#!/bin/bash -e
if [ "`cat /itgdata/patched`" == "14" ]; then
	exit 0
fi

mount /itgdata -o remount,rw
mount /dev/uba1 /mnt/flash1 || mount /dev/uba /mnt/flash1
cp "/mnt/flash1/ITG 2 r14.itg" /itgdata/temp.itg
sync
mv /itgdata/temp.itg /itgdata/default.itg
echo 14 > /itgdata/patched
sync

mount /itgdata -o remount,ro
umount /mnt/flash1

reboot
