From 59a0ff00a77d73d5ea07dc80e67ba852a1c2589f Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 27 May 2014 07:27:12 +0200 Subject: [PATCH] Use icinga2-enable-feature's multi-argument functionality in the Debian/RPM packages. Refs #6315 --- debian/icinga2-classicui.postinst | 5 +---- debian/icinga2-common.postinst | 4 +--- icinga2.spec | 12 +++--------- tools/icinga2-enable-feature.cmake | 2 +- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/debian/icinga2-classicui.postinst b/debian/icinga2-classicui.postinst index d50780c66..67636998c 100644 --- a/debian/icinga2-classicui.postinst +++ b/debian/icinga2-classicui.postinst @@ -37,10 +37,7 @@ is_fresh_install() enable_features_for_classic() { if is_fresh_install $@; then echo "enabling icinga2 features for classicui" - - for feature in compatlog statusdata command; do - icinga2-enable-feature $feature - done + icinga2-enable-feature compatlog statusdata command echo "reloading icinga2" [ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload diff --git a/debian/icinga2-common.postinst b/debian/icinga2-common.postinst index f0617644e..487f45a97 100644 --- a/debian/icinga2-common.postinst +++ b/debian/icinga2-common.postinst @@ -29,9 +29,7 @@ enable_default_features() { if is_fresh_install $@ \ || dpkg --compare-versions "$2" lt "$FIX_VERSION"; then echo "enabling default icinga2 features" - for feature in checker notification mainlog; do - icinga2-enable-feature $feature - done + icinga2-enable-feature checker notification mainlog fi # handle new default features here in the future } diff --git a/icinga2.spec b/icinga2.spec index 8ab13c448..8dac57a10 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -282,9 +282,7 @@ exit 0 if [ ${1:-0} -eq 1 ] then # initial installation, enable default features - %{_sbindir}/icinga2-enable-feature checker - %{_sbindir}/icinga2-enable-feature notification - %{_sbindir}/icinga2-enable-feature mainlog + %{_sbindir}/icinga2-enable-feature checker notification mainlog fi exit 0 @@ -311,9 +309,7 @@ exit 0 if [ ${1:-0} -eq 1 ] then # initial installation, enable default features - %{_sbindir}/icinga2-enable-feature checker - %{_sbindir}/icinga2-enable-feature notification - %{_sbindir}/icinga2-enable-feature mainlog + %{_sbindir}/icinga2-enable-feature checker notification mainlog fi exit 0 @@ -376,9 +372,7 @@ exit 0 if [ ${1:-0} -eq 1 ] then # initial installation, enable features - %{_sbindir}/icinga2-enable-feature statusdata - %{_sbindir}/icinga2-enable-feature compatlog - %{_sbindir}/icinga2-enable-feature command + %{_sbindir}/icinga2-enable-feature statusdata compatlog command fi exit 0 diff --git a/tools/icinga2-enable-feature.cmake b/tools/icinga2-enable-feature.cmake index c840ab074..02f86f24a 100644 --- a/tools/icinga2-enable-feature.cmake +++ b/tools/icinga2-enable-feature.cmake @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh ICINGA2CONFDIR=@CMAKE_INSTALL_FULL_SYSCONFDIR@/icinga2 TOOL=$(basename -- $0)