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.
