diff options
Diffstat (limited to 'www-apps/mythweb/files/reconfig')
-rw-r--r-- | www-apps/mythweb/files/reconfig | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/www-apps/mythweb/files/reconfig b/www-apps/mythweb/files/reconfig new file mode 100644 index 000000000000..01ab9aacff7a --- /dev/null +++ b/www-apps/mythweb/files/reconfig @@ -0,0 +1,39 @@ +#!/bin/bash + +die() { + echo "###" + echo $1 + echo "###" + exit 1 +} + +if [[ $1 = "install" ]]; then + + if [[ "${VHOST_SERVER}" = "apache" ]]; then + sed -e "s|/var/www/html/data|${MY_INSTALLDIR}/data|g" \ + -e "s|/var/www/html|${MY_INSTALLDIR}|g" \ + ${MY_SERVERCONFIGDIR}/${VHOST_SERVER}-mythweb.conf > \ + ${VHOST_CONFDIR}/mythweb.include || \ + die "apache sed failed" + elif [[ "${VHOST_SERVER}" = "lighttpd" ]]; then + sed -e "s|/var/www/localhost/htdocs/mythweb|${MY_INSTALLDIR}|g" \ + ${MY_SERVERCONFIGDIR}/${VHOST_SERVER}-mythweb.conf > \ + ${VHOST_CONFDIR}/mythweb.include || \ + die "lighttpd sed failed" + elif [[ "${VHOST_SERVER}" = "nginx" ]]; then + sed -e "s|VHOST_HTDOCS|${VHOST_HTDOCSDIR}|g" \ + -e "s|VHOST_APPDIR|${VHOST_APPDIR}|g" \ + ${MY_SERVERCONFIGDIR}/${VHOST_SERVER}-mythweb.include > \ + ${VHOST_CONFDIR}/mythweb.include || \ + die "nginx sed failed" + fi + + # Ownership fixes + chown ${VHOST_SERVER_UID}:${VHOST_SERVER_GID} "${MY_INSTALLDIR}"/data || \ + die "chown failed" + +elif [[ $1 = "clean" ]]; then + echo $1 +fi + +exit 0 |