Hi,

First post for me....

I use that script:

##########################################################
##########################################################

#!/bin/sh
# Start/stop/restart a Valve dedicated server

# Settings
CLIENT='Client 1';            # Unique handle this server uses. Hostname
                              # can be reset in your server.cfg

TITLE='|SD| Sitting Ducks';   # Name that is shown during start-up
messages
DSPATH='/home/CSS';           # Where Steam is installed
DSNAME='srcds_run';           # Either hlds_run or srcds_run
DSGAME='cstrike';             # Game type (valve, cstrike, czero, etc)
DSIMAP='de_dust';             # Load this map initially
DSPORT='27015';               # Game server listens on this UDP port
DSSIZE='40';                  # Maximum number of players to allow
DSCONFIG='server.cfg';        # Server config file


# Don't edit this unless you need the script to do something special
DSOPTS="-game $DSGAME +hostname \"$CLIENT\" +map $DSIMAP -port $DSPORT
+maxplayers $DSSIZE -flushlog +exec $DSCONFIG -autoupdate -tickrate 100"

service_start() {
  if [ -x $DSPATH/$DSNAME ]; then
    echo "Service $TITLE: "
    echo -n "$DSPATH/$DSNAME $DSOPTS"
    cd $DSPATH; $DSPATH/$DSNAME $DSOPTS 1> /dev/null 2> /dev/null &
    echo
    sleep 1 # prevent race condition on SMP kernels
  fi
}

service_stop() {
  # Kill $CLIENT server if it's HLDS
  if [ $DSNAME == 'hlds_run' ]; then
    for vdspid in $(ps a | grep hlds_run | grep "$CLIENT");
      do
        kill $vdspid;
        break;
    done
    for vdspid in $(ps a | grep hlds_i486 | grep "$CLIENT");
      do
        kill $vdspid;
        break;
    done
    for vdspid in $(ps a | grep hlds_i686 | grep "$CLIENT");
      do
        kill $vdspid;
        break;
    done
    for vdspid in $(ps a | grep hlds_amd | grep "$CLIENT");
      do
        kill $vdspid;
        break;
    done
    for vdspid in $(ps a | grep hlds_amd64 | grep "$CLIENT");
      do
        kill $vdspid;
        break;
    done
  fi

  # Kill $CLIENT server if it's SourceDS
  if [ $DSNAME == 'srcds_run' ]; then
    for vdspid in $(ps a | grep srcds_run | grep "$CLIENT");
      do
        kill $vdspid;
        break;
    done
    for vdspid in $(ps a | grep srcds_i486 | grep "$CLIENT");
      do
        kill $vdspid;
        break;
    done
    for vdspid in $(ps a | grep srcds_i686 | grep "$CLIENT");
      do
        kill $vdspid;
        break;
    done
    for vdspid in $(ps a | grep srcds_amd | grep "$CLIENT");
      do
        kill $vdspid;
        break;
    done
  fi
}

service_restart() {
  service_stop
  sleep 1
  service_start
}

case "$1" in
'start')
  service_start
  ;;
'stop')
  service_stop
  ;;
'restart')
  service_restart
  ;;
*)
  echo "usage $0 start|stop|restart"
Esac


##########################################################
##########################################################


It's the perfect script to start/stop CSS on linux.
It never failed.


Stephane
|SD| Quack
Owner and creator of the Sitting Ducks clan
http://www.sitting-ducks.net






-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Cory
Clemmer
Sent: 31 July 2005 11:43
To: [email protected]
Subject: Re: [hlds_linux] how to leave hlds running after closeing ssh

On 30/07/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> how to leave hlds running after closeing ssh? when I close my
> connection to the root my server quits also.

I use this command to start the server (taken from
http://www.srcds.com/db/engine.php?subaction=showfull&id=1098643920 )
screen -A -m -d -S gm-server ./srcds_run -console -game gmod +map
gm_construct +maxplayers 6

and then when I need an interactive console I use this command.
screen -x gm-server


On 31/07/05, Sebastian <[EMAIL PROTECTED]> wrote:
> why does everyone say you need screen.. you dont need it.
> we run a few servers and have never needed it.. send output to log
> file or /dev/null and a simple & sends it to the background..

Just because "you" don't have a need for something doesn't mean nobody
else does, screen is a useful tool when used properly.

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux

Reply via email to