tweaks to install-eg.sh
[sitka/sitka-tools.git] / deployment / install-eg.sh
index e26ba09..ff2aafe 100755 (executable)
@@ -31,7 +31,7 @@ if [ ! -d "${BUILDDIR}" ]
 then
   suwrap "cd ${HOMEDIR} && git clone git://git.sitka.bclibraries.ca/sitka/evergreen evergreen" ${DEFAULT_USER}
 fi
-suwrap "cd ${BUILDDIR} && git checkout ${BRANCH}" ${DEFAULT_USER}
+suwrap "cd ${BUILDDIR} && git fetch origin && git checkout ${BRANCH} && git pull" ${DEFAULT_USER}
  
 # as root
 cd ${BUILDDIR} && make -f Open-ILS/src/extras/Makefile.install ubuntu-precise
@@ -55,8 +55,11 @@ do
 done
 a2dissite default
 a2ensite eg.conf
-mkdir /etc/apache2/ssl
-cd /etc/apache2/ssl && openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
+if [ ! -d "/etc/apache2/ssl" ]
+then
+  mkdir /etc/apache2/ssl
+  cd /etc/apache2/ssl && openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key
+fi
 
 # set up log rotation
 if [ ! -d "/etc/logrotate.d/evergreen" ]
@@ -69,7 +72,7 @@ fi
 OSRFCONFFILES="${INSTALLDIR}/conf/opensrf.xml ${INSTALLDIR}/conf/opensrf_core.xml"
 for OSRFCONFFILE in ${OSRFCONFFILES}
 do
-  rm ${OSRFCONFFILE}
+  mv ${OSRFCONFFILE} ${OSRFCONFFILE}.bak
   cp ${SITKACONF}/files/${OSRFCONFFILE}/${HOSTNAME} ${OSRFCONFFILE}
 done
 if [ ! -d "${HOMEDIR}/.srfsh.xml" ]
@@ -77,11 +80,11 @@ then
   cp ${SITKACONF}/files/home/opensrf/.srfsh.xml/${HOSTNAME} ${HOMEDIR}/.srfsh.xml
 fi 
 
-# setup offline circ
-cd ${BUILDDIR} && perl Open-ILS/src/support-scripts/eg_db_config --create-offline
 # 1. install dojo
-cd /home/opensrf && wget http://download.dojotoolkit.org/release-1.3.3/dojo-release-1.3.3.tar.gz
+if [ ! -d "/home/opensrf/dojo-release-1.3.3.tar.gz" ]
+then
+  cd /home/opensrf && wget http://download.dojotoolkit.org/release-1.3.3/dojo-release-1.3.3.tar.gz
+fi
 tar -C ${INSTALLDIR}/var/web/js -xzf /home/opensrf/dojo-release-1.3.3.tar.gz
 cp -r ${INSTALLDIR}/var/web/js/dojo-release-1.3.3/* ${INSTALLDIR}/var/web/js/dojo/.