Configure apache in postinst script (code taken from phpmyadmin)

pull/605/head
Emmanuel Papin 2014-11-28 16:45:05 +01:00
parent d60131925f
commit 6628f29fdc
1 changed files with 18 additions and 0 deletions

View File

@ -2,6 +2,20 @@
set -e
apache_install() {
mkdir -p /etc/apache2/conf-available
ln -sf ../../zm/apache.conf /etc/apache2/conf-available/zoneminder.conf
COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke enconf zoneminder
elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
[ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/zoneminder.conf ] && ln -s ../conf-available/zoneminder.conf /etc/apache2/conf.d/zoneminder.conf
fi
}
if [ "$1" = "configure" ]; then
if [ -e "/etc/init.d/mysql" ]; then
#
@ -45,5 +59,9 @@ if [ "$1" = "configure" ]; then
chown www-data:www-data /var/log/zm
zmupdate.pl
fi
apache_install $1
if [ -f /etc/init.d/apache2 ] ; then
invoke-rc.d reload 3>/dev/null || true
fi
fi
#DEBHELPER#