#! /bin/bash

echo "Welcome to Z5T1's Minecraft Server Center Easy Installer!"
echo "This wizard will help you set up MCSC. All you have"
echo "to do is go through this wizard, and you'll have"
echo "your own Minecraft server up in no time!"
echo "Press enter to continue, or 'dev' to use a dev build."
read dev
if [ "$dev" == "dev" ]
then
	if [ "$TERM_PROGRAM" == "Apple_Terminal" ]
	then
		echo "**************************************************************************
This version of Minecraft Server Center is not supported on this platform!
**************************************************************************

Dev builds are for Linux only!"
	exit
else
	echo "Downloading the latest dev release of MCSC"
	wget z5t1.com/mcsc/update/update-dev.zip ./update.zip
	echo "Extracting the latest development release"
	unzip -u update.zip
	echo "Starting Minecraft Server Center Development version"
	./mcsc
	exit
fi
if [ "$TERM_PROGRAM" == "Apple_Terminal" ]
then
	echo "Downloading the latest Mac port of MCSC"
	echo "This port is maintained by Geek (olympus-gaming.net)"
	curl z5t1.com/mcsc/update/update-mac.zip ./update.zip
	echo "Extracting the latest port"
	unzip -u update.zip
else
	echo "Downloading the latest Linux release of MCSC"
	wget z5t1.com/mcsc/update/update.zip ./update.zip
	echo "Extracting the latest release"
	unzip -u update.zip
fi
echo "Starting Minecraft Server Center..."
./mcsc
exit
