Okay, so months ago when I got my box, my clan mate talked me into getting linux. I greatly regret it now, but everything is setup and what not so im not too interested in doing it all over again. However, I have since lost touch with him, and I am trying to fix up some of the shell scripts he made that don't work. I am hoping you guys can help me make these better. I usually log into putty/webmin as root, but all these files owner is GS and GSadmins is group. So I am trying to make it so these custom commands work, I guess it needs sudo or something? I am horrible with Linux and I need help bad =/
Really sorry for the long post, I just really need these working as running around trying to do this in putty is driving me crazy
Start TFS1 -
Stop TFS1 -
Restart TFS1 -
Update TFS1 -
Really sorry for the long post, I just really need these working as running around trying to do this in putty is driving me crazy
Start TFS1 -
Code:
#/bin/sh
rcmd="su -c"
userset="GS"
dir="/home/GS/TFS1/srcds_l/orangebox"
screenset="screen -A -m -d -S TFS1"
coreset="taskset -c 0"
srcdsbin="srcds_run"
srcdsname="TFS1.pid"
TFS1test=`ps ax | grep TFS1 | grep -v grep | wc -l`
options="-console +fps_max 600 -tickrate 66 -game tf +ip 216.117.168.162 -port 27016 +maxplayers 26 +map ctf_2fort -pidfile TFS1.pid"
if [ $TFS1test -eq 2 ]
then
echo " "
echo "Server Not Running. Possible Shutdown Or Crash. Restarting Now."
echo " "
cd $dir
$rcmd "$screenset $coreset ./$srcdsbin $options" $userset>/dev/null 2>&1
else
echo " "
echo "Server Already Running."
echo " "
fi
Stop TFS1 -
Code:
echo "Stopping Server"
screen -dr TFS1 -X quit
echo " "
echo "Server Stopped"
Restart TFS1 -
Code:
echo "Restarting Server"
echo "screen -dr TFS1 -X quit"
screen -dr TFS1 -X quit
echo "Server Stop successful"
echo "cd .."
echo "cd .."
echo "cd .."
echo "/home/GS/TFS1/Scripts"
cd ..
cd ..
cd ..
cd /home/GS/TFS1/Scripts
sh start_TFS1.sh
echo "sh start_TFS1.sh"
echo "Server Restart Successful"
Update TFS1 -
Code:
echo "**************************************************************************"
echo "Stopping Server Processes"
echo "**************************************************************************"
date=`date +%Y%m%d`
echo "Stopping Server TFS1"
screen -dr TFS1 -X quit
echo " "
echo "Server TFS1 Stopped"
echo "**************************************************************************"
echo "Starting Server Updates"
echo "**************************************************************************"
echo "TFS1 Update"
cd /home/GS/TFS1/srcds_l
./steam -command update -game tf -dir /home/GS/TFS1/srcds_l -retry
echo "TFS1 Update Complete"
echo "**************************************************************************"
echo "Starting Server Processes"
echo "**************************************************************************"
echo "Starting Server TFS1"
echo "cd .."
echo "cd .."
echo "cd /home/GS/TFS1/Scripts"
echo "sh start_TFS1.sh"
cd /home/GS/TFS1/Scripts
sh start_TFS1.sh
echo "Server TFS1 Started"