install-eg.sh: loop through skin dirs; create skin dir if it does not exist
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 10 Jul 2015 20:04:44 +0000 (13:04 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 10 Jul 2015 20:04:44 +0000 (13:04 -0700)
deployment/install-eg.sh

index f0e89e1..5d1d360 100755 (executable)
@@ -207,8 +207,12 @@ done
 # 9. make sure opensrf owns all the stuff we just did
 chown -R opensrf:opensrf ${INSTALLDIR}
 chown -R opensrf:opensrf /home/opensrf
-chmod 777 ${INSTALLDIR}/var/skins ; chown -R sitkastaff:sitkastaff ${INSTALLDIR}/var/skins
-chmod 777 ${INSTALLDIR}/var/web/css/skin ; chown -R sitkastaff:sitkastaff ${INSTALLDIR}/var/web/css/skin
+SKINDIRS="${INSTALLDIR}/var/skins ${INSTALLDIR}/var/web/css/skin"
+for SKINDIR in ${SKINDIRS} ; do
+  if [[ ! -d "${SKINDIR}" ]] ; then mkdir ${SKINDIR} ; fi
+  chmod 777 ${SKINDIR}
+  chown -R sitkastaff:sitkastaff ${SKINDIR}
+done
 
 # 10. staff client stuff
 apt-get install -y nsis unzip