The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 Re: Quake3 dedicated server as a daemon on start-up?
Author: .daniel.schrock 
Date:   05-03-02 19:23

here is my start script:

#!/bin/sh

case $1 in
start)
if [ -x /usr/local/bin/q3server ]; then
/usr/local/bin/q3server && echo "Starting Quake3 server..."
fi
if [ -x /usr/local/bin/ra3server ]; then
/usr/local/bin/ra3server && echo "Starting Rocket Arena server..."
fi
;;
stop)
ps aux | grep q3ded | grep -v grep | awk '{print $2}' | xargs -t kill $2;
ps aux | grep quake3.x86 | grep -v grep | awk '{print $2}' | xargs -t kill $2;
;;
q3start)
ps aux | grep q3ded | grep -v grep | awk '{print $2}';
# if [ $2 != ""]; then
# echo "Quake 3 Server is already running"
# exit 0;
#else
/usr/local/bin/q3server && echo "Starting Quake3 server..."
ps aux | grep q3ded | grep -v grep
#fi
;;
ra3start)
ps aux | grep quake3.x86 | grep -v grep | awk '{print $2}';
if [ $2 -eq ""]; then
echo "Rocket Arena 3 Server is already running"
exit 0;
else
/usr/local/bin/ra3server && echo "Starting Rocket Arena 3 server..."
ps aux | grep quake3.x86 | grep -v grep
fi
;;
q3stop)
ps aux | grep q3ded | grep -v grep | awk '{print $2}' | xargs -t kill $2;
;;
ra3stop)
ps aux | grep quake3.x86 | grep -v grep | awk '{print $2}' | xargs -t kill $2;
;;
status)
echo 'Checking for q3 process...'
ps auxwww | grep q3ded | grep -v grep
echo ''
echo 'Checking q3 info...'
/usr/local/bin/q3ctrl --info
echo ''
echo 'Checking q3 status...'
/usr/local/bin/q3ctrl --status
echo ''
echo ''
echo 'Checking for ra3 process...'
ps auxwww | grep quake3.x86 | grep -v grep
echo ''
echo 'Checking ra3 info...'
/usr/local/bin/ra3ctrl --info
echo ''
echo 'Checking ra3 status...'
/usr/local/bin/ra3ctrl --status
;;
*)
echo "Usage: `basename $0` { start | stop | q3start | q3stop | ra3start | ra3stop | status }"
exit 64
;;

esac

exit 0

here are the scripts that are run by the above:
q3server:
#!/bin/sh
cd /usr/local/quake3
./q3ded +set com_hunkmegs 64 +set dedicated 2 +set net_ip xxx.xxx.xxx.xxx +set net_port 27960 +set sv_pure
1 +set sv_allowdownload 1 +set fs_base "/usr/local/quake3" +exec q3server.cfg &

ra3server:
#!/bin/sh
cd /usr/local/quake3
./quake3.x86 +set com_hunkmegs 64 +set fs_game arena +set sv_pure 1 +bot_enable 0 +set dedicated 2 +set net
_ip xxx.xxx.xxx.xxx +set net_port 27970 +set sv_allowdownload 1 +set fs_base "/usr/local/quake3" +exec ra3s
erver.cfg &



be sure to edit these to follow your paths and IPs.
keep in mind that once gamespy knows of your servers, your bandwidth will get sucked up fast, if you have a decent connection. This is why i stopped running my q3 and ra3 servers, but I still get people trying to connect on occasion.

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 Quake3 dedicated server as a daemon on start-up?   new
bryan 05-03-02 08:54 
 Re: Quake3 dedicated server as a daemon on start-up?   new
.daniel.schrock 05-03-02 19:23 
 Re: Quake3 dedicated server as a daemon on start-up?   new
bryan 06-03-02 01:01 
 Re: Quake3 dedicated server as a daemon on start-up?   new
.daniel.schrock 06-03-02 01:55 
 Re: Quake3 dedicated server as a daemon on start-up?   new
F l y 03-11-06 12:06 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org