Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Linux Programming & Scripting > Process switch/flip script for COD/ET/Q3 dedicated servers

Forgot Password?
 Linux Programming & Scripting   C, Perl, PHP, Bash Scripts, anything programming or script related post in here!

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 02-22-2005   #1 (permalink)
Just Joined!
 
Join Date: Feb 2005
Posts: 1
Process switch/flip script for COD/ET/Q3 dedicated servers

Hi there, i hope i can be assisted in what im trying to achieve.

i will be working on this fully operational script and want to develop it further so when the process is terminated the script will start the alternate process. If that is terminated then i want it to run the 1st process and so on.

heres the current script:

_____________________________
#!/bin/sh

etdir="/usr/local/games/et"
process=`ps auxw | grep et-1.x86 | grep -v grep | awk '{print $11}'`

if [ -z "$process" ]; then

echo "Couldn't find ET et-raw.x86 running, restarting it."
cd "$etdir"
nohup ./et-1.x86 +set fs_basepath /usr/local/games/et +set fs_homepath /usr/local/games/et +set dedicated 2 +exec 1.cfg &
echo ""

fi

_____________________________

This is run by a cron command to check every minute if the process is running.

As I said previously, the script is working fine, it will however require the need for an additional "nohup" command which is 'rotational'

1st process of the 'cycle'
nohup ./et-1.x86 +set fs_basepath /usr/local/games/et +set fs_homepath /usr/local/games/et +set dedicated 2 +exec 1.cfg &

2nd process of the 'cycle'
nohup ./et-1.x86 +set fs_basepath /usr/local/games/et2 +set fs_homepath /usr/local/games/et2 +set dedicated 2 +set fs_game etpro +exec 1.cf &

Once the 1st process is terminated, the 2nd process will startup the other variation of the server. IF this is terminated, the script will startup the 1st process and so on and so forth, flipping between the 2 processes.

Thanks in advance for any advice given.


randomronald is offline  


Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 06:53 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2