fixed regressions as a result of adding the prefix feature
authorAndy Witter <awitter@georgialibraries.org>
Thu, 13 Dec 2012 16:23:40 +0000 (11:23 -0500)
committerAndy Witter <awitter@georgialibraries.org>
Thu, 13 Dec 2012 16:23:40 +0000 (11:23 -0500)
.gitignore
GenaSYS.sh

index 7f43536..8a0d564 100644 (file)
@@ -6,3 +6,4 @@ config/
 TODO
 .GenaSYS.sh-old
 .GenaSYS.sh.swp
+.GenaSYS.sh-bak
index c16c20c..3d1346a 100755 (executable)
@@ -25,8 +25,8 @@
     PURPOSE_="Generate config files needed for Evergreen-ILS Cluster"
    SYNOPSIS_="$NAME_"
    REQUIRES_="standard GNU commands, apt, dpkg"
-    VERSION_="0.96"
-       DATE_="2010-09-18; last update: 2012-11-16"
+    VERSION_="0.97"
+       DATE_="2010-09-18; last update: 2012-12-13"
      AUTHOR_="Andy Witter <awitter@georgialibraries.org>"
         URL_="http://evergreen-ils.org"
    CATEGORY_="devel"
@@ -61,17 +61,24 @@ PRIVATENET="$DEFAULT_PRIVATE_NET"
 OSRF_USERNAME="opensrf"
 DB_USERNAME="evergreen"
 #DRONECOUNT="2"
-TMPHOSTS="/tmp/tmphost.txt"
-TMPZONEFILE="/tmp/tmpzonefile.txt"
-TMPREVZONEFILE="/tmp/tmprevzonefile.txt"
-TMPOSRFNODES="/tmp/tmposrfnodes"
-TMPOPENSRF_XML="/tmp/tmpopensrf.xml"
+TMPFOLDER="/tmp/GenaSYS"
+TMPHOSTS="${TMPFOLDER}/tmphost.txt"
+TMPZONEFILE="${TMPFOLDER}/tmpzonefile.txt"
+TMPREVZONEFILE="${TMPFOLDER}/tmprevzonefile.txt"
+TMPOSRFNODES="${TMPFOLDER}/tmposrfnodes"
+TMPOPENSRF_XML="${TMPFOLDER}/tmpopensrf.xml"
 PSQL_VERSION="9.1"
 [ -z $CONFIG_FILE ] && CONFIG_FILE="$WD/genasys.conf"
 NEW_CONFIG_FILE="$OUTDIR/genasys.conf"
 CERT_DIR="${OUTDIR}/ssl_cert"
 
-
+if [ -e ${TMPFOLDER} ] 
+then
+       rm -rf ${TMPFOLDER} || sudo rm -rf ${TMPFOLDER}
+       mkdir -p ${TMPFOLDER}
+else
+       mkdir -p ${TMPFOLDER}
+fi
 #TMPBRICKDRONES="/tmp/tmpbricknodes"
 
 
@@ -2038,9 +2045,15 @@ printf " |\r";sleep 0.05; printf " /\r";sleep 0.05; printf -- ' - \r';sleep 0.05
        cp "$TEMPLATEDIR/setup.sh" "setup_${NODE_FOLDER}/setup_$NODE_FOLDER.sh"
        cp "$TEMPLATEDIR/setup-vars" "setup_${NODE_FOLDER}/setup-vars"
        cp "$TEMPLATEDIR/setup-functions" "setup_${NODE_FOLDER}/setup-functions"
-       if [ -e "$TEMPLATEDIR/apt/${NODE_FOLDER}_apt.list" ]
+       if [[ "$USE_HOSTNAME_PREFIX" = "y" || "$USE_HOSTNAME_PREFIX" = "Y" ]]
+                then
+                NODE_FOLDER_NO_PREFIX=$(echo $NODE_FOLDER|awk -F"-" '{ print $2  }')
+                else
+                NODE_FOLDER_NO_PREFIX=$NODE_FOLDER
+        fi
+       if [ -e "$TEMPLATEDIR/apt/${NODE_FOLDER_NO_PREFIX}_apt.list" ]
                then
-                cp "$TEMPLATEDIR/apt/${NODE_FOLDER}_apt.list" "setup_${NODE_FOLDER}"
+                cp "$TEMPLATEDIR/apt/${NODE_FOLDER_NO_PREFIX}_apt.list" "setup_${NODE_FOLDER}/${NODE_FOLDER}_apt.list"
                        else
                        cp "$TEMPLATEDIR/apt/apt.list" "setup_${NODE_FOLDER}/${NODE_FOLDER}_apt.list"
        fi