morphene
05-31-2004, 03:34 AM
Hey Everyone. :)
I've just set up my own box, and can start my server at the command prompt like so:
./cod_lnxded +map_rotate
Which works fine, although if I close the console window, the server will close.
So, from reading a few websites, I created a start.sh script with the following code called start.sh:
#!/bin/bash
#
gamedir=/usr/local/games/cod
pidfile=CoD.pid
cd $gamedir
if [ -f $pidfile ]; then
kill -0 `cat $pidfile` >/dev/null 2>&1
if [ $? -ne 0 ]; then
./cod_lnxded +map_rotate >/dev/null 2>&1
fi
else
./cod_lnxded +map_rotate >/dev/null 2>&1
fi
When i run it with:
./start.sh &
I get:
server# ./start.sh &
[1] 12083
server# ./start.sh: Command not found.
I am running FreeBSD if that helps anyone. Would appreciate any comments, or alternatives to running the server in the background so that the console window can be closed.
Thanks everyone :)
I've just set up my own box, and can start my server at the command prompt like so:
./cod_lnxded +map_rotate
Which works fine, although if I close the console window, the server will close.
So, from reading a few websites, I created a start.sh script with the following code called start.sh:
#!/bin/bash
#
gamedir=/usr/local/games/cod
pidfile=CoD.pid
cd $gamedir
if [ -f $pidfile ]; then
kill -0 `cat $pidfile` >/dev/null 2>&1
if [ $? -ne 0 ]; then
./cod_lnxded +map_rotate >/dev/null 2>&1
fi
else
./cod_lnxded +map_rotate >/dev/null 2>&1
fi
When i run it with:
./start.sh &
I get:
server# ./start.sh &
[1] 12083
server# ./start.sh: Command not found.
I am running FreeBSD if that helps anyone. Would appreciate any comments, or alternatives to running the server in the background so that the console window can be closed.
Thanks everyone :)