#!/bin/sh
ver=469
pagever=46x
#tools required for macOS since the default installation of macOS doesnt come with coreutils
installdep(){
xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install wget
}
installcheckloop(){
if [ -z $(which brew) ] || [ -z $(which wget) ]; then
installdep
installcheckloop
fi
}
installcheckloop
if [ ! -f empires-server-macOS-${ver} ]; then
wget "https://github.com/Questandachievement7Developer/RaiseTheEmpiresPort_Native/releases/download/Build_${pagever}/empires-server-macOS-${ver}" -O empires-server-macOS
else
echo "empires-server has been downloaded"
fi
chmod +x empires-server-macOS
