#!/bin/bash PF=${PN}-${PVR} die() { echo "******" echo $1 echo "******" exit 1 } if [ $1 = "install" ]; then # edit Apache configs cd ${VHOST_ROOT}/${PF}/scripts sed -e "s|/opt/otrs/var/httpd/htdocs/|${MY_INSTALLDIR}/|g" -i apache-httpd.include.conf apache2-httpd.include.conf || die "sed failed" # set $HOME grep -lR "/opt" * | xargs sed -i "s|/opt/otrs|${VHOST_ROOT}/${PF}|g" || die "sed failed" sed -i "s|/opt/otrs|${VHOST_ROOT}/${PF}|g" ${VHOST_ROOT}/${PF}/Kernel/Config.pm || die "sed failed" # set permissions ${VHOST_ROOT}/${PF}/bin/SetPermissions.sh ${VHOST_ROOT}/${PF} otrs apache apache apache > /dev/null || die "Could not set permissions" elif [ $1 = "clean" ]; then echo "Please examine the contents of the following directories" echo "and delete anything that is no longer necessary" echo echo ${VHOST_ROOT}/${PF} echo ${MY_INSTALLDIR} fi