SRCDS Steam group

Shutdown screen

I want to be able to stop the screen or if there is any other better ways to run.

I am creating a startup start / shutdown for my css server so this would be the startup.

echo "Starting CS:Source Server 1"
sleep 1
screen -A -m -d -S css-server1 ./srcds_run -console -game cstrike +map de_dust +maxplayers 24 -autoupdate -ip 217.***.85.30 -port 27015

But what would the command be to shutdown?


echo "Stopping CS: Source Server 1"
sleep 1
screen -S css-server1 -X stuff 'quit'`echo -ne '\015'`
sleep 1
echo "Server shutdown successfully."
the screen -S specifies the screen name, -X stuff sends the command, quite is the command and echo -ne '\015'` is the enter key being pressed.

In effect the script opens up your screen, types quit and then presses enter, all without showing you it.
[Image: ggbarzc2.png]
I have a 1:line command, but no echo..

kill $(ps -ef | grep src | grep Loginname | grep -v grep | awk '{print $2}' )

This line is used on a box with 2 users running 1 server each, and its only killing the users srcds-pid..
Replace Loginname with your user name..

Forum Jump:

Users browsing this thread: 1 Guest(s)