install-eg.sh: handle prod opensrf config files
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Thu, 19 May 2016 19:47:07 +0000 (12:47 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Thu, 19 May 2016 19:47:07 +0000 (12:47 -0700)
deployment/install-eg.sh

index 48b40bf..78f7d71 100755 (executable)
@@ -125,11 +125,14 @@ fi
 OSRFCONFFILES="${INSTALLDIR}/conf/opensrf.xml ${INSTALLDIR}/conf/opensrf_core.xml"
 for OSRFCONFFILE in ${OSRFCONFFILES}
 do
-  if `cmp -s ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}` ; then
+  mkdir -p /tmp/${OSRFCONFFILE}
+  cp ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} /tmp/${OSRFCONFFILE}/${HOSTNAME}
+  sed -i "S|__HOSTNAME__|${THISHOST}|g" /tmp/${OSRFCONFFILE}/${HOSTNAME}
+  if `cmp -s ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} /tmp/${OSRFCONFFILE}/${HOSTNAME}` ; then
     echo "${OSRFCONFFILE} is unchanged, so not updating"
   else
     mv ${OSRFCONFFILE} ${OSRFCONFFILE}.bak
-    cp ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}
+    cp /tmp/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}
   fi
 done
 if [ ! -f "/home/opensrf/.srfsh.xml" ]