SRCDS Steam group


srcds bash script won't run
#1
First, I may be going about this wrong. I have a dedi server that runs Linux and I want the game server to run when I am not connected with Putty.

I created the server.sh to run srcds in the background, but I can not execute it. I create the script in Notepad. Installed the server to /srcds
Code:
#!/bin/sh
echo "Starting Cs:Source Server"
sleep 1
screen -A -m -d -S css-server /srcds/srcds_run -game cstrike -console +ip
x.x.x.x -port 27015 +maxplayers 24 +exec server.cfg +map de_aztec

Code:
root@myserver:~# ls
server.sh srcds
root@myserver:~# chmod +x server.sh
root@myserver:~# server.sh
bash: server.sh: command not found
Reply
#2
./server.sh
Reply
#3
Code:
root@myserver:~# ./server.sh
-bash: ./server.sh: cannot execute binary file

That is when I save it as a UTF file. Under unicode, it produces this:

Code:
root@myserver:~# ./server.sh
-bash: ./server.sh: /bin/server.ch^M: bad interpreter: No such file or directory
Reply
#4
Well the way I was doing it was rubbish. Instead, I deleted the file from my server and used "vi" to create the file. Now, it works fine except the server doesn't seem to start. Can not find it by checking the IP to see if the server is running.

E: server is running. Just not working >< keeps restarting.
Reply
#5
Don't set port or ip
[Image: b_350x20_C002748-004880-FFFFFF-000000.png]
Reply
#6
looks like windows put extra characters into the script. edit the script with a linux txt editor and remove all the extra stuff like the ^M
Reply
#7
you must start srcds_run from the directory where it is located. so first go there:
Code:
cd /srcds
then start your screen:
Code:
screen -A -m -d -S css-server ./srcds_run -game cstrike -console +ip x.x.x.x -port 27015 +maxplayers 24 +exec server.cfg +map de_aztec
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#8
Actually the problem was the server didn't have enough RAM.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)