SRCDS Steam group


[Resolved] Problem with bash script.
#5
Code:
#!/bin/bash
#  Copyright (c)2010-2010
#  Ulrich Block
#                                                                  
#  Kontakt:
#  ulblock at gmx.de    
#  www.ulrich-block.de  
#
#

function init {

DIR="/home/USER/prueba1"
DEAMON="hlds_run"
PARAMS="-game cstrike -ip IPP -port 27015 -pingboost 3"
PARAMS2="+maxplayers 14 +map de_dust2 +sys_ticrate 1010 +fps_max 0 +exec cfg/server0.cfg"
NAME="server0"

if [ "`whoami`" = "root" ]; then
echo "Dont run the script as root!"
exit 0
fi

}

function start_server {

if [[ `screen -ls | grep $NAME` ]]; then
echo "Server: $NAME, is already running."
else
echo "Starting $NAME"
cd $DIR
`chrt -r 98 screen -dmS $NAME ./$DEAMON $PARAMS $PARAMS2`;
fi
}

function stop_server {

if [[ `screen -ls | grep $NAME` ]]; then
echo -n "Stopping $NAME"
kill `screen -ls | grep $NAME | awk -F . '{print $1}'| awk '{print $1}'`
echo " ... done."
else
echo "Server: $NAME isnt already running."
fi
}


function wrong_input {
echo "Usage: $0 {start|stop|restart|console}"
exit 1
}

function get_screen {
screen -r $NAME
}

init

case "$1" in
start)
start_server
;;

stop)
stop_server
;;

restart)
stop_server
start_server
;;

console)
get_screen
;;

*)
wrong_input
;;

esac

exit 0

My problem went away.. I edited "liblist.gam" and remove metamod dll..

thanks BehaartesEtwas & TerrorKakarote.. Im using ur script Smile (terror)
Reply


Messages In This Thread
RE: [Help] Problem with bash script. - enano - 08-22-2010, 12:24 AM

Forum Jump:


Users browsing this thread: