#!/bin/sh
echo " " ;
echo "-  Install Global-Offensive Server... ... ....Please Wait." ;
echo " " ;
sleep 2 ;
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" ;
echo " " ;
sleep 2 ;
echo "- Sending Server TERM-Signals... ... ...." ;
echo " " ;
sleep 2 ;
killall -vwq hltv ;
sleep 2 ;
rm -rf /home/$USER/servers/hlds/hltv.pid ;
echo " " ;
killall -vwq hlds_run;
sleep 2 ;
rm -rf /home/$USER/servers/hlds/startup.pid ;
echo " " ;
killall -vwq hlds_linux ;
sleep 2 ;
rm -rf /home/$USER/servers/hlds/startup.pid ;
echo " " ;
killall -vwq srcds_run ;
sleep 2 ;
rm -rf /home/$USER/servers/srcds/startup.pid ;
echo " " ;
killall -vwq srcds_linux ;
sleep 2 ;
rm -rf /home/$USER/servers/srcds/startup.pid ;
echo " " ;
killall -vwq hltv ;
sleep 2 ;
rm -rf /home/$USER/servers/hlds/startup.pid ;
echo " " ;
sleep 2 ;
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" ;
echo " " ;
sleep 2 ;
echo "- Backup Old Server files... ... ....." ;
echo " " ;
sleep 2 ;
rm -rf /home/$USER/servers/backup/servers1/srcds
echo " " ;
sleep 2 ;
mv -v /home/$USER/servers/backup/servers0/srcds /home/$USER/servers/backup/servers1/srcds
echo " " ;
sleep 2 ;
mv -v /home/$USER/servers/backup/servers/srcds /home/$USER/servers/backup/servers0/srcds
echo " " ;
sleep 2 ;
mv -v /home/$USER/servers/srcds/ /home/$USER/servers/backup/servers
echo " " ;
sleep 2 ;
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
echo " " ;
sleep 2 ;
echo "- Installing Server from Template... ... ....." ;
echo " " ;
sleep 2 ;
nice cp -avr /home/default/servers/srcds/ /home/$USER/servers > /dev/null 2>&1
echo " " ;
sleep 2 ;
echo "- Installing Startup Command... ... ....." ;
echo " " ;
sleep 2 ;
cp -avrf /home/$USER/run_go.sh /home/$USER/servers/srcds
echo " " ;
sleep 2 ;
echo "- Installing Configuration Templates... ... ....." ;
echo " " ;
sleep 2 ;
tar -xzvf def_srcds.tar.gz --overwrite
echo " " ;
sleep 2 ;
echo "- Set File Permissions... ... ....." ;
echo " " ;
sleep 2 ;
chmod -R 775 /home/$USER/servers/
echo " " ;
sleep 2 ;
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" ;
echo " " ;
sleep 4 ;
echo "     -  Your Global-Offensive Server is Ready ! ! !"
echo " " ;
echo " " ;
echo " " ;
echo " " ;
echo " " ;
echo " " ;