#!/bin/sh MAGENTODIR='%%MAGENTODIR%%' var="${PKG_PREFIX}/${MAGENTODIR}/var" WWWOWN="%%WWWOWN%%" WWWGRP="%%WWWGRP%%" medialist='media media/customer media/dhl media/downloadable media/xmlconnect' medialist="${medialist} media/dhl/logo.jpg" medialist="${medialist} media/downloadable/.htaccess" medialist="${medialist} media/xmlconnect/custom/ok.gif" medialist="${medialist} media/xmlconnect/original/ok.gif" medialist="${medialist} media/xmlconnect/system/ok.gif" if [ $2 = "POST-INSTALL" ] then find ${var} -type d -exec chmod 777 {} + # var/cache should be world-writeable so that commandline tools like # magerun do not create /tmp/magento/var/cache. if [ -d ${var}/cache ] then find ${var}/cache -type f -exec chmod 666 {} + fi # Make no assumptions about what else is in the media directory, so # only install our files and directories with correct ownership. for entry in ${medialist} do chown ${WWWOWN}:${WWWGRP} ${PKG_PREFIX}/${MAGENTODIR}/${entry} done fi