diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:39:40 +0000 |
commit | 92b71369d9c622791ec7758cb3ecfc256031e24d (patch) | |
tree | 45fb3f91bbfec5ecb364ceea5a2f4afe31ab57c1 /debian/icingaweb2.postinst | |
parent | Adding upstream version 2.11.4. (diff) | |
download | icingaweb2-92b71369d9c622791ec7758cb3ecfc256031e24d.tar.xz icingaweb2-92b71369d9c622791ec7758cb3ecfc256031e24d.zip |
Adding debian version 2.11.4-2+deb12u1.debian/2.11.4-2+deb12u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | debian/icingaweb2.postinst | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/debian/icingaweb2.postinst b/debian/icingaweb2.postinst new file mode 100644 index 0000000..6ed6e06 --- /dev/null +++ b/debian/icingaweb2.postinst @@ -0,0 +1,43 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) + + # NEW method for Apache >= 2.4 + if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then + . /usr/share/apache2/apache2-maintscript-helper + + apache2_invoke enmod rewrite + apache2_invoke enconf icingaweb2 + + # remove OLD Apache 2.2 link + [ -L /etc/apache2/conf.d/icingaweb2.conf ] && rm /etc/apache2/conf.d/icingaweb2.conf + + # OLD methods for Apache < 2.4 + elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then + # enable mod rewrite + [ -e /etc/apache2/mods-enabled/rewrite.load ] || a2enmod rewrite + + # create symlink if not existing + [ -e /etc/apache2/conf.d/icingaweb2.conf ] || ln -vs ../conf-available/icingaweb2.conf /etc/apache2/conf.d/icingaweb2.conf + + # reload webserver + [ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 |