#Update and install the Orca screen-reader
sudo apt-get -y update
sudo apt-get -y install gnome-orca unzip espeak
echo Installing Hansoft Version $1
HPORT=${1:(-2)}
echo Port will be 502${HPORT}
mkdir $1
cd $1
echo "Getting server wget -q http://cache.hansoft.com/Hansoft%20Server%20${1}%20Linux2.6%20x64.zip"
wget -q http://cache.hansoft.com/Hansoft%20Server%20${1}%20Linux2.6%20x64.zip
echo "Getting client wget -q http://cache.hansoft.com/Hansoft%20${1}%20Linux2.6%20x64.zip"
wget -q http://cache.hansoft.com/Hansoft%20${1}%20Linux2.6%20x64.zip
echo Uncompressing Server...
echo unzip Hansoft\ Server*
unzip Hansoft\ Server*
echo Setting Up Hansoft Instance...
cd HansoftServer
./HPMServer -Install -ServerName Vagrant -ServerHostname `hostname` -Port 502${HPORT} -ServerAdminPassword rein4ce -DatabaseName rein4ce -DatabaseAdminPassword rein4ce -ServiceName HPServer -RunAsUser kwirth -RunAsGroup kwirth
cd ..
echo Setting up start.sh...
echo cd /filestoreSSD/Vagrant/Hansoft/$1/HansoftServer > start.sh
echo nohup /filestoreSSD/Vagrant/Hansoft/$1/HansoftServer/HPMServer -RunAsProgram -OverridePort 502${HPORT} >> start.sh && chmod +x start.sh
echo Setting up Hansoft client...
echo /filestoreSSD/Vagrant/Hansoft/10.0025/HansoftServer/ServerSync/Client/Linux2.6/x64/Hansoft > Hansoft && chmod +x Hansoft
echo Finished.