#!/bin/sh -e # some shorthands for sanity en="/etc/nagios4" enc="/etc/nagios4/conf.d" usn="/usr/share/nagios4" ln="/var/lib/nagios4" # location of the default apache configuration for nagios. apacheconf="${en}/apache2.conf" # location of the default htdigest authentication file. htdigest="${en}/htdigest.users" setperm() { local user="${1}" local group="${2}" local mode="${3}" local file="${4}" shift 4 # only do something when no setting exists if ! dpkg-statoverride --list "${file}" >/dev/null 2>&1 then if [ -e "${file}" ] then chown "${user}":"${group}" "${file}" chmod "${mode}" "${file}" fi fi } case "${1}" in remove) if [ -e "${ln}/rw" ] then setperm nagios nagios 0755 "${ln}" setperm nagios nagios 0700 "${ln}/rw" fi ;; purge) rm -f "${en}/htpasswd.users" rm -f "${htdigest}" rm -f "${apacheconf}" if which ucf >/dev/null 2>&1 then ucf --purge "${apacheconf}" fi if [ -e "${ln}/rw" ] then setperm nagios nagios 0750 "${ln}" setperm nagios nagios 0700 "${ln}/rw" fi ;; esac # Automatically added by dh_apache2/UNDECLARED if [ "$1" = "purge" ] ; then if true; then if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then . /usr/share/apache2/apache2-maintscript-helper for conf in nagios4-cgi ; do apache2_invoke disconf $conf || exit 1 done fi fi fi # End automatically added section