(Bad english) I'm trying to make a script for hlds, it work's (start 2 or 3 servers) but each others doesn't run completly.
HLDS says: ./hlds_run: line 321: 25189 Violación de segmento $HL_CMD
my code:
HLDS says: ./hlds_run: line 321: 25189 Violación de segmento $HL_CMD
my code:
Code:
#!/bin/bash
#-------------------------------------------------------
#-Settings----------------------------------------------
#-------------------------------------------------------
DIR=/home/USER/prueba1
DAEMON='hlds_run';
param='-game cstrike -ip 200.3.44.5 +sys_ticrate 1010 +map de_dust2 -pingboost 3 +fps_max 0';
#-------------------------------------------------------
#-Servers-----------------------------------------------
#-------------------------------------------------------
# Agregar servidores, reemplazar variables con un numero
# diferente.. por ejemplo name1.. name2.. port1.. port2
#-------------------------------------------------------
#Server0
name0='server0';
param0='-port 27015 -maxplayers 14 +exec cfg/server0.cfg';
#Server1
name1='server1';
param1='-port 27045 -maxplayers 14 +exec cfg/server1.cfg';
#Server2
name2='server2';
param2='-port 27060 -maxplayers 14 +exec cfg/server2.cfg';
#Server3
name3='server3';
param3='-port 27030 -maxplayers 12 +exec cfg/server3.cfg';
case "$1" in
start)
if [[ `screen -ls | grep $name0` ]]
then
echo "Server $name0 is already running!";
else
cd $DIR;
echo "Starting Server: $name0";
chrt -r 98 screen -AmdS $name0 ./$DAEMON $param $param0;
fi
if [[ `screen -ls | grep $name1` ]]
then
echo "Server $name1 is already running!";
else
cd $DIR;
echo "Starting Server: $name1";
chrt -r 98 screen -AmdS $name1 ./$DAEMON $param $param1;
fi
if [[ `screen -ls | grep $name2` ]]
then
echo "Server $name2 is already running!";
else
cd $DIR;
echo "Starting Server: $name2";
chrt -r 98 screen -AmdS $name2 ./$DAEMON $param $param2;
fi
if [[ `screen -ls | grep $name3` ]]
then
echo "Server $name3 is already running!";
else
cd $DIR;
echo "Starting Server: $name3";
chrt -r 98 screen -AmdS $name3 ./$DAEMON $param $param3;
fi
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0