btmux/autom4te.cache/
btmux/doc/.svn/
btmux/event/.svn/
btmux/game/.svn/
btmux/game/bin/.svn/
btmux/game/data/.svn/
btmux/game/logs/.svn/
btmux/game/maps/
btmux/game/maps/.svn/
btmux/game/maps/.svn/prop-base/
btmux/game/maps/.svn/props/
btmux/game/maps/.svn/text-base/
btmux/game/maps/.svn/wcprops/
btmux/game/mechs/
btmux/game/mechs/.svn/
btmux/game/mechs/.svn/prop-base/
btmux/game/mechs/.svn/props/
btmux/game/mechs/.svn/text-base/
btmux/game/mechs/.svn/wcprops/
btmux/game/text/.svn/
btmux/include/.svn/
btmux/misc/
btmux/misc/.svn/
btmux/misc/.svn/prop-base/
btmux/misc/.svn/props/
btmux/misc/.svn/text-base/
btmux/misc/.svn/wcprops/
btmux/python/
btmux/python/.svn/
btmux/python/.svn/prop-base/
btmux/python/.svn/props/
btmux/python/.svn/text-base/
btmux/python/.svn/wcprops/
btmux/src/.svn/prop-base/
btmux/src/.svn/props/
btmux/src/.svn/text-base/
btmux/src/.svn/wcprops/
btmux/src/hcode/.svn/
btmux/src/hcode/btech/
btmux/src/hcode/btech/.svn/
btmux/src/hcode/btech/.svn/prop-base/
btmux/src/hcode/btech/.svn/props/
btmux/src/hcode/btech/.svn/text-base/
btmux/src/hcode/btech/.svn/wcprops/
btmux/src/hcode/include/.svn/
#!/bin/sh
#
#	Startmux - Kick off the netmux process.
#
export LD_LIBRARY_PATH=/usr/local/lib
PATH=/usr/ucb:/bin:/usr/bin:.; export PATH
#
. mux.config
#
#	Make sure there isn't aready a MUX running.
#

#nmux=`ps -C netmux l | egrep "netmux netmux.conf"`
numx=`ps ax | sed -e '/grep/d' | grep "netmux netmux.conf"`
if [ "$?" -ne 1 ]; then
    echo "Another copy of netmux is running"
    echo "Check ps ax"
	exit 0
fi
#
#	Make sure the indexes are up-to-date.
#
$BIN/mkindx $TEXT/news.txt $TEXT/news.indx
$BIN/mkindx $TEXT/help.txt $TEXT/help.indx
$BIN/mkindx $TEXT/wizhelp.txt $TEXT/wizhelp.indx
$BIN/mkindx $TEXT/plushelp.txt $TEXT/plushelp.indx
$BIN/mkindx $TEXT/wiznews.txt $TEXT/wiznews.indx
#
#	Save a copy of the previous input database and log.
#
if [ -r $DATA/$INPUT_DB ]; then
	mv -f $DATA/$INPUT_DB $DATA/$SAVE_DB
fi
mv -f $LOGNAME $LOGNAME.old
#
#	If we have a good checkpoint database, make it the input database.
#	If not, use the backup of the input database.
#
if [ -r $DATA/$NEW_DB ]; then
	mv $DATA/$NEW_DB $DATA/$INPUT_DB
else
	cp $DATA/$SAVE_DB $DATA/$INPUT_DB
fi
#
#	Remove the restart db if there is one.
#
if [ -r restart.db ]; then
	rm restart.db
fi

#
#	Refuse to start if CORRUPT or KILLED databases are present.
#
if [ -r $DATA/$INPUT_DB.KILLED -o -r $DATA/$INPUT_DB.CORRUPT -o -r $DATA/$INPUT_DB.CRASH ]; then
	echo "There is a CORRUPT, KILLED or CRASH database present." 
	echo "You should salvage what you can before continuing."
	exit 1
fi

#
#	Kick off MUX
#
ulimit -c unlimited
(nohup $BIN/netmux $GAMENAME.conf >$LOGNAME 2>&1 &)