#!/bin/sh # # Startmux - Kick off the netmux process. # PATH=/usr/ucb:/bin:/usr/bin:.; export PATH # . /home/tanlaan/mux2.4/game/mux.config # # Make sure there isn't already a MUX running. # if [ -r "$PIDFILE" ]; then oldpid=`cat $PIDFILE` if [ "$oldpid" -gt 1 ]; then nmux=`ps | grep $oldpid | grep netmux | wc -l` if [ "$nmux" -gt 0 ]; then echo "The MUX already seems to be running." exit 0 fi fi fi # # Save a copy of the previous input database. # if [ -r $DATA/$INPUT_DB ]; then mv -f $DATA/$INPUT_DB $DATA/$SAVE_DB fi # # 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 elif [ -r $DATA/$SAVE_DB ]; then 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 CRASH databases are present. # if [ -r $DATA/$INPUT_DB.CRASH ]; then echo "There is a CRASH database present." echo "You should salvage what you can before continuing." exit 1 fi # # Kick off MUX # (nohup $BIN/netmux -c $GAMENAME.conf -p $PIDFILE >/dev/null 2>&1 &) CONFIG FILE # mux.config - constants for mux shell scripts # # Change these variables as appropriate # # NOTE: GAMENAME, DATA, and TEXT here -must- agree with the settings in # your $GAMENAME.conf file. The ./Startmux, ./Backup, and _backupflat.sh # scripts depend on this assumption. # BIN=./bin TEXT=./text DATA=./data GAMENAME=infinity OWNER=tanlaan33@gmail.com # # If you use compression, uncomment this and put the extension here. # #COMPRESSION=.gz # # You should never need to change these. # NEW_DB=$GAMENAME.db.new$COMPRESSION INPUT_DB=$GAMENAME.db$COMPRESSION GDBM_DB=$GAMENAME CRASH_DB=$GAMENAME.db.CRASH SAVE_DB=$GAMENAME.db.old$COMPRESSION PIDFILE=$GAMENAME.pid What the terminal does after modification tanlaan@tanlaan:~$ /home/tanlaan/mux2.4/game/Startmux tanlaan@tanlaan:~$