#
# Read the cnf file and set some variables.
#
-INDB=`egrep "^input_database" $CONF_FILE | sed "s/.*[ ][ ]*.*\/\(.*\)/\1/" | sed 's/\r$//'`
-OUTDB=`egrep "^output_database" $CONF_FILE | sed "s/.*[ ][ ]*.*\/\(.*\)/\1/" | sed 's/\r$//'`
-PANICDB=`egrep "^crash_database" $CONF_FILE | sed "s/.*[ ][ ]*.*\/\(.*\)/\1/" | sed 's/\r$//'`
-PANICDIR=`egrep "^crash_database" $CONF_FILE | sed "s/.*[ ][ ]*\(.*\)\/.*/\1/" | sed 's/\r$//'`
+INDB=`egrep "^input_database" $CONF_FILE | sed "s/[^[:space:]][[:space:]]*.*\/\(.*\)/\1/" | sed 's/\r$//'`
+OUTDB=`egrep "^output_database" $CONF_FILE | sed "s/[^[:space:]][[:space:]]*.*\/\(.*\)/\1/" | sed 's/\r$//'`
+PANICDB=`egrep "^crash_database" $CONF_FILE | sed "s/[^[:space:]][[:space:]]*.*\/\(.*\)/\1/" | sed 's/\r$//'`
+PANICDIR=`egrep "^crash_database" $CONF_FILE | sed "s/[^[:space:]][[:space:]]*\(.*\)\/.*/\1/" | sed 's/\r$//'`
COMPRESSOR="cat"
SUFFIX=""
# Find out what the compression program is, if any
-egrep -s "^compress_program[ ]*[A-Za-z0-9]" $CONF_FILE
+egrep -s "^compress_program[[:space:]]*[[:alnum:]/]" $CONF_FILE
nocompress=$?
if [ "$nocompress" -eq 0 ]; then
- COMPRESSOR=`egrep "^compress_program" $CONF_FILE | sed "s/[^ ]*[ ]*\(.*\)/\1/" | sed 's/\r$//'`
- SUFFIX=`egrep "^compress_suffix" $CONF_FILE | sed "s/[^ ]*[ ]*\(.*\)/\1/" | sed 's/\r$//'`
+ COMPRESSOR=`egrep "^compress_program" $CONF_FILE | sed "s/[^[:space:]]*[[:space:]]*\(.*\)/\1/" | sed 's/\r$//'`
+ SUFFIX=`egrep "^compress_suffix" $CONF_FILE | sed "s/[^[:space:]]*[[:space:]]*\(.*\)/\1/" | sed 's/\r$//'`
fi
-
#-- start up everything
# Prevent double-starting things. You may need to provide a pathname for
fi
fi
-# Move the last set of log files to save/
-mv -f log/*.log save/
+# Copy the last set of log files to save/ with a timestamp.
+TIMESTAMP=`date +%Y%m%d%H%M%S`
+for log in log/*.log; do
+ BASE=`basename $log`
+ mv -f $log save/$BASE.$TIMESTAMP
+done
+
# Copy the latest core or netmud.core to save/
if [ -r "core" ]; then
fi
if [ -r "data/$OUTDB$SUFFIX" ]; then
- rm -f save/$INDB$SUFFIX.old
- mv -f data/$INDB$SUFFIX save/$INDB$SUFFIX.old
+ ln -f data/$INDB$SUFFIX save/$INDB$SUFFIX.old
+ mv -f data/$INDB$SUFFIX save/$INDB$SUFFIX.$TIMESTAMP
mv data/$OUTDB$SUFFIX data/$INDB$SUFFIX
else
echo "No $OUTDB$SUFFIX found."
DATEMSK="${GAMEDIR}/getdate.template"
export DATEMSK
-LC_ALL=$LANG LANG=$LANG ./netmush $GAMEDIR/$CONF_FILE &
+LC_ALL=$LANG LANG=$LANG ./netmush $@ --pid-file=$PIDFILE $GAMEDIR/$CONF_FILE &