install-eg.sh: be less fancy with config template files eg210
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Sun, 22 May 2016 05:35:33 +0000 (22:35 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Sun, 22 May 2016 05:36:55 +0000 (22:36 -0700)
deployment/install-eg.sh

index b23f81c..fc90476 100755 (executable)
@@ -77,12 +77,8 @@ mv ${INSTALLDIR}/var/web/reports/fm_IDL.xml ${INSTALLDIR}/var/web/reports/fm_IDL
 APACHEFILES="/etc/apache2/eg_vhost.conf /etc/apache2/eg_startup /etc/apache2/envvars"
 for APACHEFILE in ${APACHEFILES}
 do
 APACHEFILES="/etc/apache2/eg_vhost.conf /etc/apache2/eg_startup /etc/apache2/envvars"
 for APACHEFILE in ${APACHEFILES}
 do
-  if `cmp -s ${SITKACONF}/files/${APACHEFILE}/${HOSTNAME} ${APACHEFILE}` ; then
-    echo "${APACHEFILE} is unchanged, so not updating"
-  else
-    mv ${APACHEFILE} ${APACHEFILE}.bak
-    cp ${SITKACONF}/files/${APACHEFILE}/${HOSTNAME} ${APACHEFILE}
-  fi
+  mv ${APACHEFILE} ${APACHEFILE}.`date +%Y-%m-%d-%H%M%S`
+  cp ${SITKACONF}/files/${APACHEFILE}/${HOSTNAME} ${APACHEFILE}
 done
 #if [ ! -d "/etc/apache2/ssl" ]
 #then
 done
 #if [ ! -d "/etc/apache2/ssl" ]
 #then
@@ -124,15 +120,9 @@ fi
 OSRFCONFFILES="${INSTALLDIR}/conf/opensrf.xml ${INSTALLDIR}/conf/opensrf_core.xml"
 for OSRFCONFFILE in ${OSRFCONFFILES}
 do
 OSRFCONFFILES="${INSTALLDIR}/conf/opensrf.xml ${INSTALLDIR}/conf/opensrf_core.xml"
 for OSRFCONFFILE in ${OSRFCONFFILES}
 do
-  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 /tmp/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}
-  fi
+  mv ${OSRFCONFFILE} ${OSRFCONFFILE}.`date +%Y-%m-%d-%H%M%S`
+  cp ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}
+  sed -i "s|__HOSTNAME__|${THISHOST}|g" ${OSRFCONFFILE}
 done
 if [ ! -f "/home/opensrf/.srfsh.xml" ]
 then
 done
 if [ ! -f "/home/opensrf/.srfsh.xml" ]
 then