#!/bin/bash

echo "Please be sure you have an active connection to the internet while running this script."
echo

x11FP="/usr/X11"

if [ -d $x11FP ]; then
	echo "X11 Library Found!"
	echo
else
	echo "X11 not found in standard location '/usr/X11'. If it is in a different"
	echo "location, please edit the config.mk file in the 'src' directory of your"
	echo "XPilot-AI download to point to this altered location."
	exit 0
fi

echo "***NOTE: If you are currently on the Connecticut College wireless network, install and turn on your VPN Client.***"
echo

echo "CD ~/Downloads..."
cd ~/Downloads
echo "Download XPilot-AI source..."
curl -O http://xpilot-ai.org/downloads/xpilot-ai-osx-0.5.7-src.tar.gz
echo "Unpack gunzip file..."
tar xvf xpilot-ai-osx-0.5.7-src.tar.gz
echo "CD to XPilot-AI source directory..."
cd xpilot-ai-osx-0.5.7/src
echo "Compile XPilot-AI..."
make
echo "Install XPilot-AI..."
sudo make install

