# 6. deletepatron
# ensure apache conf contains deletepatron config (location should be ${INSTALLDIR}/var/web/deletepatron)
-#cd ${INSTALLDIR}/var/web && git clone https://github.com/twirlip/deletepatron.git
-#cd ${INSTALLDIR}/var/web/deletepatron && git checkout eg22 && find . -name "*.pm" | xargs sed -i -e 's|/openils|/srv/openils|g'
+if [[ ! -d "${INSTALLDIR}/var/web/deletepatron" ]] ; then
+ NEW_DELETEPATRON_INSTALL="true"
+ cd ${INSTALLDIR}/var/web && git clone https://github.com/twirlip/deletepatron.git
+fi
+cd ${INSTALLDIR}/var/web/deletepatron && git checkout eg22
+if [[ -n "$NEW_DELETEPATRON_INSTALL" ]] ; then
+ find ${INSTALLDIR}/var/web/deletepatron -name "*.pm" | xargs sed -i -e 's|/openils|/srv/openils|g'
+fi
apt-get install -y libcgi-session-perl libhtml-template-perl
# 7. support scripts - XXX deprecated?
mkdir -p ${INSTALLDIR}/var/data/offline/blocked
fi
fi
-if [ ! -e "${INSTALLDIR}/var/web/standalone/list.txt" ] ; then ln -s ${INSTALLDIR}/var/data/offline/blocked/patron-block-list.txt ${INSTALLDIR}/var/web/standalone/list.txt ; fi
+if [ ! -e "${INSTALLDIR}/var/web/standalone/list.txt" ] ; then ln -sf ${INSTALLDIR}/var/data/offline/blocked/patron-block-list.txt ${INSTALLDIR}/var/web/standalone/list.txt ; fi
if [ ! -e "${INSTALLDIR}/bin/update-offline-blocked-list.sh" ] ; then cp ${SITKATOOLS}/maintenance/update-offline-blocked-list.sh ${INSTALLDIR}/bin/update-offline-blocked-list.sh ; fi
cp ${SITKACONF}/files${INSTALLDIR}/var/data/zips.txt/${HOSTNAME} ${INSTALLDIR}/var/data/zips.txt
# 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
+chmod 777 ${INSTALLDIR}/var/web/css/skin
# 10. staff client stuff
apt-get install -y nsis unzip