#!/bin/bash if [ $1 == "install" ] ; then fixFile() { local sedStr=${1} while [ $# -gt 1 ] ; do shift if [ -f ${1} ] ; then sed -i -e "${sedStr}" ${1} fi done } sedStr="s|\(^CONF_PATHNAME\) = None\$|\1 = \"${VHOST_ROOT}/${PN}.conf\"|g" fixFile "${sedStr}" ${VHOST_CGIBINDIR}/{${PN},query}.cgi fixFile "${sedStr}" ${VHOST_HTDOCSDIR}/${VHOST_APPDIR}/{${PN},query,handler}.py unset sedStr sedStr="s|\(^template_dir = \)\(templates\$\)|\1${VHOST_HTDOCSDIR}/${PN}/\2|g" findpat="${VHOST_CONFDIR}/.*${PN}.conf" if ! stat ${findpat} > /dev/null ; then findpat="${VHOST_CONFDIR}/${PN}.conf" fi fixFile "${sedStr}" ${findpat} unset findpat unset sedStr fi