Misc build & configuration file fixes
authorRick L Bird <nveid@yahoo.com>
Sat, 23 Apr 2011 03:43:40 +0000 (23:43 -0400)
committerRick L Bird <nveid@yahoo.com>
Sat, 23 Apr 2011 03:43:40 +0000 (23:43 -0400)
game/mushcnf.dst
game/restart.dst
src/help.c

index 76a9d673e358b692e07d44a561361041584321e8..4abda0800883f99c6eee95c8655438d1b24eff99 100644 (file)
@@ -326,11 +326,6 @@ max_parents        10
 # What's the max chain length of indirect locks allowed?
 max_depth      10
 
-# How many @functions can we have? If you change this without # doing a
-# shutdown (or shutdown/reboot) immediately thereafter, you'll very likely
-# crash your MUSH, so don't do that.
-max_global_fns 80
-
 # How much does it cost a mortal to create a channel?
 chan_cost      1000
 
index 2a653587194b17c2013f8d39cb4777f3d47e804e..64b9b3eafae28f2edbc5aae0656e6b444ad44c02 100644 (file)
@@ -118,22 +118,21 @@ fi
 #
 # 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
@@ -164,8 +163,13 @@ if [ -r "$PANICDIR/$PANICDB" ]; then
    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
@@ -176,8 +180,8 @@ if [ -r "netmud.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."
@@ -201,4 +205,4 @@ fi
 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 &
index df932d804a9afeef24bca6bcf7f5bbcfa7d992a7..e14db26246a4238d464fae12a1be505fd9092e1d 100644 (file)
@@ -9,6 +9,7 @@
 #define _XOPEN_SOURCE 600
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <errno.h>