Added framework to create restart out of restart.dst As this script wasnt' being...
authorRick L Bird <nveid@yahoo.com>
Sun, 8 May 2011 23:35:06 +0000 (19:35 -0400)
committerAri Johnson <ari@theari.com>
Mon, 9 May 2011 00:00:01 +0000 (19:00 -0500)
Makefile.in
configure.ac
utils/checkrestart.sh [new file with mode: 0755]
utils/preparedist.sh

index 98318d8d0b9f2562fa9e39cda0183ea3260a979b..4697972a9b9309ae110f5897755ae5333259bf3c 100644 (file)
@@ -128,14 +128,7 @@ customize: update-conf
 # other game directories.
 GAMEDIR=game
 
-update-conf: game/mushcnf.dst game/aliascnf.dst game/restrictcnf.dst game/namescnf.dst
-       -@@TOUCH@ game/mushcnf.dst
-       -@@PERL@ utils/update-cnf.pl $(GAMEDIR)/mush.cnf game/mushcnf.dst
-       -@@TOUCH@ game/aliascnf.dst
-       -@@PERL@ utils/update-cnf.pl $(GAMEDIR)/alias.cnf game/aliascnf.dst
-       -@@TOUCH@ game/restrictcnf.dst
-       -@@PERL@ utils/update-cnf.pl $(GAMEDIR)/restrict.cnf game/restrictcnf.dst
-       -@if [ ! -f $(GAMEDIR)/names.cnf ]; then $(CP) game/namescnf.dst $(GAMEDIR)/names.cnf; fi
+update-conf: game/mush.cnf game/alias.cnf game/restrict.cnf game/names.cnf game/restart
 
 $(GAMEDIR)/alias.cnf: game/aliascnf.dst
        -@@TOUCH@ game/aliascnf.dst
@@ -150,6 +143,19 @@ $(GAMEDIR)/names.cnf: game/namescnf.dst
                $(CP) game/namescnf.dst $(GAMEDIR)/names.cnf \
        fi
 
+$(GAMEDIR)/restart: game/restart.dst
+ifeq ("$(shell which bash)", "")
+       @echo "********************************************************************************";
+       @echo "* Restart script has been updated in this distribution.                        *";
+       @echo "* However, bash has not been installed on your system.                         *";
+       @echo "* Please cp game/restart.dst to game/restart if you would like our updated     *";
+       @echo "* restart script.                                                              *";
+       @echo "********************************************************************************";
+else
+       -@@BASH@ utils/checkrestart.sh
+endif
+
+
 $(GAMEDIR)/mush.cnf: game/mushcnf.dst
        -@@TOUCH@ game/mushcnf.dst
        -@@PERL@ utils/update-cnf.pl $(GAMEDIR)/mush.cnf game/mushcnf.dst
index e324915fc72c08ed5eae09d777dd8132ec0c8ead..e6d0b689b5f411a8d2238429576e33013dfac311 100644 (file)
@@ -43,6 +43,7 @@ if test "${PERL+set}" != "set"; then
    AC_MSG_ERROR([perl is required to build and run CobraMUSH])
 fi
 
+AC_PATH_PROG(BASH, bash)
 AC_PATH_PROG(TEST, test)
 AC_PATH_PROG(TOUCH, touch)
 AC_PATH_PROG(RM, rm)
diff --git a/utils/checkrestart.sh b/utils/checkrestart.sh
new file mode 100755 (executable)
index 0000000..d29d625
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Many systems are switching to dash are their default shell.. Well.. its syntax breaks us so we need to specify bash.
+
+if test ! -f game/restart ; then 
+       echo "Creating restart script from restart.dst";
+       cp game/restart.dst game/restart;
+else  
+       read -p "Restart script has changed in this distribution.  Should we replace your current restart script with ours?" -n 1;
+       if [[ $REPLY =~ ^[Yy]$ ]];then 
+           echo -e "\nSaving your restart script as restart.bup.";
+           cp game/restart game/restart.bup;
+           echo "Moving restart.dst to restart.";
+           cp game/restart.dst game/restart;
+        else
+         echo -e "\nOk.. not copying";
+       fi
+fi
index c6c89b882a50f87f9b9ad97d0444b5f8b3818dd6..1b1f50a8097b10a05dfcd1d2f41113a834bff2b8 100755 (executable)
@@ -15,6 +15,7 @@ chmod 755 utils/customize.pl
 chmod 755 utils/make_access_cnf.sh
 chmod 755 utils/update-cnf.pl
 chmod 755 utils/update.pl
+chmod 755 utils/checkrestart.sh
 
 # Step 2: create auto-generated source/header files
 echo "Generating source and header files..."