SRCDS Steam group


Need a shell script!
#1
I need to be able to run these three servers using these commands:

screen -A -m -d -S css-server taskset -c 1 ./srcds_run -console -game cstrike +map de_inferno -maxplayers 10 -autoupdate +fps_max 500 +tv_enable -port 27012

screen -A -m -d -S css-serverclimb taskset -c 1 ./srcds_run -console -game cstrike +map xc_future -maxplayers 16 -autoupdate +fps_max 500 -port 27013

screen -A -m -d -S css-serverfun taskset -c 0 ./srcds_run -console -game cstrike +map deathrun_tribute_final -maxplayers 26 -autoupdate +fps_max 500 +tv_enable -port 27011

The directory are different, i.e for the first server the directory is : /home/shared/match/srcds_l/orangebox

The second directory is:
/home/shared/funserver/orangebox

The third directory is:
/home/shared/climb/orangebox

Need this all in .sh file so it runs each server..
Reply
#2
just add the location before the srcds_run, eg:

screen -A -m -d -S css-serverfun taskset -c 0 /home/shared/climb/./srcds_run -console -game cstrike +map deathrun_tribute_final -maxplayers 26 -autoupdate +fps_max 500 +tv_enable -port 27011
Reply
#3
Ohhh... I have to do /./?
Reply
#4
Maybe this will help:

#!/bin/bash
PATH=/bin:/usr/bin:/sbin:/usr/sbin
<Check pls
DIR=/home/shared/funserver/orangebox
<Check pls
PARAMETERS="-console -game cstrike +map de_inferno -maxplayers 10 -autoupdate +fps_max 500 +tv_enable -port 27012"
PROC="css-serverfun"

case "$1" in
start)
if [[ `ps -ef | grep $PROC` ]]
then
echo "Can't start $PROC. Status: online"
else
if [ -e $DIR ];
then
cd $DIR
screen -A -m -d -S $PROC taskset -c 0 ./srcds_run $PARAMETERS
else
echo "$DIR doesn't exist"
fi
;;
stop)
if [[ `ps -ef | grep $PROC` ]]
then
echo "Killing $PROC"
kill -9 `ps -ef |grep $PROC |awk '{print $2}'`
else
echo "$PROC is OFFLINE"
fi
;;
*)
echo "Start with parameters: $0 {start|stop}"
exit 1
;;
esac
exit 0


Maybe some little typo's: start the script ./<name> start after you did a chmod +x <name> to the script
Google around for more scripting or ask here

Warning Level: 0%
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)