diff --git a/debian/libapache2-mod-tile.postinst b/debian/libapache2-mod-tile.postinst index 56d2769..21091ee 100644 --- a/debian/libapache2-mod-tile.postinst +++ b/debian/libapache2-mod-tile.postinst @@ -3,6 +3,17 @@ mkdir -p /var/lib/mod_tile chown www-data:www-data /var/lib/mod_tile +if [ "$1" = configure ] ; then + # only enable on new installs, not on upgrades + if [ -z "$2" ] ; then + a2enmod tile + fi + # only restart if mod_something is enabled + if [ -e /etc/apache2/mods-enabled/tile.load ] ; then + invoke-rc.d apache2 restart + fi +fi + # automatically install munin plugins if munin is present. if [ -d /etc/munin/plugins ] then diff --git a/debian/libapache2-mod-tile.prerm b/debian/libapache2-mod-tile.prerm index 75249eb..f1c0299 100644 --- a/debian/libapache2-mod-tile.prerm +++ b/debian/libapache2-mod-tile.prerm @@ -1,5 +1,10 @@ #!/bin/sh +if [ "$1" = remove ] ; then + a2dismod -q -f tile || true + invoke-rc.d apache2 restart +fi + # automatically remove munin plugins if [ -d /etc/munin/plugins ] then