#!/bin/sh
echo " " ;
echo "     -  Start/ReStart Server... ... ....Please Wait." ;
echo " " ;
sleep 1 ;
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" ;
echo " " ;
sleep 1 ;
echo "     - Sending TERM-Signals... ... ....." ;
echo " " ;
sleep 1 ;
killall -vwq hltv ;
sleep 1 ;
rm -rf /home/$USER/servers/hlds/hltv.pid ;
echo " " ;
killall -vwq hlds_run;
sleep 1 ;
rm -rf /home/$USER/servers/hlds/startup.pid ;
echo " " ;
killall -vwq hlds_linux ;
sleep 1 ;
rm -rf /home/$USER/servers/hlds/startup.pid ;
echo " " ;
killall -vwq srcds_run ;
sleep 1 ;
rm -rf /home/$USER/servers/srcds/startup.pid ;
echo " " ;
killall -vwq srcds_linux ;
sleep 1 ;
rm -rf /home/$USER/servers/srcds/startup.pid ;
echo " " ;
killall -vwq hltv ;
sleep 1 ;
rm -rf /home/$USER/servers/hlds/startup.pid ;
echo " " ;
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" ;
echo " " ;
echo "     - Starting Server... ... ...." ;
echo " " ;
sleep 1 ;
cd /home/$USER/servers/hlds/
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH" 
export SteamAppId=10 ;
./run_cs.sh > /dev/null 2>&1 &
echo " " ;
sleep 1 ;
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" ;
echo " " ;
sleep 1 ;
echo "     -  Server Start Completed ! ! !" ;
echo " " ;

exit 0