diff options
-rw-r--r-- | debian/netdata-apache2.postinst | 25 | ||||
-rw-r--r-- | debian/netdata-apache2.postrm | 10 |
2 files changed, 14 insertions, 21 deletions
diff --git a/debian/netdata-apache2.postinst b/debian/netdata-apache2.postinst index 07fe736b..7c8e0ce2 100644 --- a/debian/netdata-apache2.postinst +++ b/debian/netdata-apache2.postinst @@ -4,26 +4,17 @@ set -e case "${1}" in configure) - if [ -x "$(which a2enmod)" ] + if [ -e /usr/share/apache2/apache2-maintscript-helper ] then - a2enmod proxy proxy_http rewrite - fi + . /usr/share/apache2/apache2-maintscript-helper - if [ -x "$(which a2enconf)" ] - then - a2enconf netdata - fi + apache2_invoke enmod proxy + apache2_invoke enmod proxy_http + apache2_invoke enmod rewrite - if [ -x "/etc/init.d/apache2" ] - then - if [ -n "${2}" ] - then - ACTION="restart" - else - ACTION="start" - fi - - invoke-rc.d apache2 ${ACTION} || true + apache2_invoke enconf netdata.conf + + apache2_reload restart fi ;; diff --git a/debian/netdata-apache2.postrm b/debian/netdata-apache2.postrm index 65564036..b69fdbc1 100644 --- a/debian/netdata-apache2.postrm +++ b/debian/netdata-apache2.postrm @@ -4,11 +4,13 @@ set -e case "${1}" in remove) - a2disconf netdata > /dev/null 2>&1 || true - - if [ -x /etc/init.d/apache2 ] && [ -e /run/apache2/apache2.pid ] + if [ -e /usr/share/apache2/apache2-maintscript-helper ] then - invoke-rc.d apache2 restart || true + . /usr/share/apache2/apache2-maintscript-helper + + apache2_invoke disconf netdata.conf + + apache2_reload restart fi ;; |