install-eg.sh: handle prod opensrf config files
[sitka/sitka-tools.git] / 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" ]