#!/bin/bash
# Script to install earthtrack/earthtrack2
#
if [ ! -x $PWD/earthtrack ]; then
	$PWD/build
fi

whoami=`whoami`

if [ $whoami != "root" ]; then
	echo "Sorry, $whoami.  You need to be 'root' to install this program.  :-("
else
	rm -f /usr/local/bin/earthtrack
	ln -s $PWD/earthtrack /usr/local/bin/earthtrack
fi

if [ ! -x /usr/local/bin/earthtrack2 ]; then
	if [ $whoami != "root" ]; then
		echo "Please su to root and re-run the 'install' script again."
	else
		ln -s /usr/local/bin/earthtrack /usr/local/bin/earthtrack2
	fi
fi
