#!/bin/bash

echo ''
echo '-----------------------------------------------------------------'
echo '  Your InterAction studios game will start shortly!'
echo '-----------------------------------------------------------------'
echo '  The End User License Agreement (EULA) will now be displayed.'
echo '  Please read through it carefully.'
echo '-----------------------------------------------------------------'
echo ''
read -p 'Press ENTER to start...'			

more -d license.txt

echo ''
echo '-----------------------------------------------------------------'
echo "  Do you agree to this End User License Agreement? (Y/N)"
echo '-----------------------------------------------------------------'
echo ''

agree=""
while [ "$agree" != "y" -a "$agree" != "Y" -a "$agree" != "n" -a "$agree" != "N" ]; do
	read -n 1 -p "Press Y for 'yes', or N for 'no': " agree
	echo ""
done

if [ "$agree" != "y" -a "$agree" != "Y" ]; then
	echo ''
	echo '-----------------------------------------------------------------'
	echo '  You must agree to the End User License Agreement'
	echo '  before you can play this game.';
	echo '-----------------------------------------------------------------'
	echo ''
	chmod -x ../game/game.exe
	read -p 'Press ENTER to finish.'
	exit 1;
fi

touch .agreedToEULA
chmod +x ../game/game.exe

