ok i have a game server and i was wondering how i could get this script to run when my server starts automaticly.
./ucc server DM-Antalus?GameSpeed=1.00?WeaponStay=True?MaxLives=0?AutoAdjust=False?Mutator=MapVote400b9.Mapvote,VasS aveToServerV2x14.VasSaveToServer,VasOnFire.VasOnFireMutator?GameStats=False?MinPlayers=6?MaxPlayers= 12?MaxSpectators=2?AdminName=*******?AdminPassword=*****?difficulty=5 ini=UT2003.ini -nohomedir
i would like it to start in run lvl 3 and 5 duhh
. If it helps i got this but i am not sure on how to make it work. If i had to take a guess i would have to say that i would have to put some kinda line in my rc3.d and rc5.d folder but not sure what. BTW i am running RH9 if it helps.
#!/bin/sh
BASEDIR=/usr/local/games/ut2003_dedicated
COMMAND="ucc server DM-Antalus?GameSpeed=1.00?WeaponStay=True?MaxLives=0?AutoAdjust=False?Mutator=MapVote400b9.Mapvote,VasS aveToServerV2x14.VasSaveToServer,VasOnFire.VasOnFireMutator?GameStats=False?MinPlayers=6?MaxPlayers= 12?MaxSpectators=2?AdminName=****?AdminPassword=******?difficulty=5 ini=UT2003.ini -nohomedir" LOGFILE=$BASEDIR/server.log
UCCINITPIDFILE=$BASEDIR/ucc.init.pid
UCCPIDFILE=$BASEDIR/ucc.pid
case "$1" in
start)
echo starting ucc.init and ucc
$0 fork &
echo $! > $UCCINITPIDFILE
disown
;;
stop)
if test -f $UCCINITPIDFILE ; then
if ps -p `cat $UCCINITPIDFILE` | grep ucc.init 1> /dev/null 2> /dev/null ; then
echo killing ucc.init
kill -TERM `cat $UCCINITPIDFILE` 1> /dev/null 2> /dev/null
sleep 2
kill -9 `cat $UCCINITPIDFILE` 1> /dev/null 2> /dev/null
fi
rm $UCCINITPIDFILE
fi
if test -f $UCCPIDFILE ; then
if ps -p `cat $UCCPIDFILE` | grep ucc 1> /dev/null 2> /dev/null ; then
echo killing ucc
kill -TERM `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null
sleep 2
kill -9 `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null
fi
rm $UCCPIDFILE
fi
;;
restart)
$0 stop
$0 start
;;
check)
if test -f $UCCINITPIDFILE ; then
if ! ps -p `cat $UCCINITPIDFILE` | grep ucc.init 1> /dev/null 2> /dev/null ; then
if test -f $UCCPIDFILE ; then
if ps -p `cat $UCCPIDFILE` | grep ucc 1> /dev/null 2> /dev/null ; then
kill -TERM `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null
sleep 2
kill -9 `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null
fi
rm $UCCPIDFILE
fi
rm $UCCINITPIDFILE
$0 start > /dev/null
fi
else
if test -f $UCCPIDFILE ; then
if ps -p `cat $UCCPIDFILE` | grep ucc 1> /dev/null 2> /dev/null ; then
kill -TERM `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null
sleep 2
kill -9 `cat $UCCPIDFILE` 1> /dev/null 2> /dev/null
fi
rm $UCCPIDFILE
fi
$0 start > /dev/null
fi
;;
fork)
while [ true ] ; do
if test -f $LOGFILE ; then
mv $LOGFILE $LOGFILE.old
fi
$BASEDIR/$COMMAND -log > $LOGFILE &
echo $! > $UCCPIDFILE
wait
done
;;
*)
echo "Usage: $0 {start|stop|restart|check}"
;;
esac