From: Alexander Wirt Date: Mon, 18 Feb 2013 12:54:36 +0000 (+0100) Subject: Handle pnp4nagios.cfg symlink also for icinga X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=859490a1a4fddd5dfd7904fd9eb718e4d3fbf20a;p=pkg-pnp4nagios.git Handle pnp4nagios.cfg symlink also for icinga --- diff --git a/debian/pnp4nagios-bin.postinst b/debian/pnp4nagios-bin.postinst index d3bc340..9e69290 100644 --- a/debian/pnp4nagios-bin.postinst +++ b/debian/pnp4nagios-bin.postinst @@ -50,6 +50,12 @@ case "$1" in ln -s /etc/pnp4nagios/nagios.cfg /etc/nagios3/conf.d/pnp4nagios.cfg fi fi + if [ -d /etc/icinga/objects/ ]; then + if [ ! -e /etc/icinga/objects/pnp4nagios.cfg ]; then + ln -s /etc/pnp4nagios/nagios.cfg /etc/icinga/objects/pnp4nagios.cfg + fi + fi + ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/pnp4nagios-bin.postrm b/debian/pnp4nagios-bin.postrm index 7e12fcd..369f60b 100644 --- a/debian/pnp4nagios-bin.postrm +++ b/debian/pnp4nagios-bin.postrm @@ -29,6 +29,15 @@ case "$1" in fi fi fi + if [ -d /etc/icinga/objects/ ]; then + if [ -L /etc/icinga/objects/pnp4nagios.cfg ]; then + ls -l /etc/icinga/objects/pnp4nagios.cfg | grep -q /etc/pnp4nagios/nagios.cfg + if [ $? -eq 0 ]; then + rm -f /etc/icinga/objects/pnp4nagios.cfg + fi + fi + fi + ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;;