]> granicus.if.org Git - icinga2/commitdiff
Refactor mods-enabled/mods-available.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 27 Sep 2013 09:16:35 +0000 (11:16 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 27 Sep 2013 09:16:35 +0000 (11:16 +0200)
configure.ac
etc/icinga2/Makefile.am
etc/icinga2/features-available/Makefile.am [moved from etc/icinga2/mods-available/Makefile.am with 68% similarity]
etc/icinga2/features-available/compat.conf [moved from etc/icinga2/mods-available/compat.conf with 94% similarity]
etc/icinga2/mods-available/compat.load [deleted file]
tools/Makefile.am
tools/i2enfeature.in [new file with mode: 0644]
tools/i2modconf.in [deleted file]

index 39d53aa1e34a2eb33e2aadbe5c09c008dfb58788..d9478cab81df80919cd9fca9aa56035fec70ba16 100644 (file)
@@ -139,7 +139,7 @@ docs/Makefile
 etc/Makefile
 etc/icinga2/Makefile
 etc/icinga2/conf.d/Makefile
-etc/icinga2/mods-available/Makefile
+etc/icinga2/features-available/Makefile
 etc/init.d/Makefile
 icinga-app/Makefile
 itl/Makefile
@@ -155,7 +155,7 @@ third-party/cJSON/Makefile
 third-party/execvpe/Makefile
 third-party/mmatch/Makefile
 tools/Makefile
-tools/i2modconf
+tools/i2enfeature
 tools/mkembedconfig/Makefile
 ])
 AC_OUTPUT([
index 3007070762de6a3e4f9f115599ad5e706f8fffc7..e652d3c34afa815ffdbfdeb3941a575e31c3e5af 100644 (file)
@@ -2,7 +2,7 @@
 
 SUBDIRS = \
        conf.d \
-       mods-available
+       features-available
 
 icinga2confdir = $(sysconfdir)/icinga2
 
@@ -20,7 +20,7 @@ EXTRA_DIST = $(CONFIG_FILES)
 
 install-exec-hook:
        @cd $(icinga2confdir) && \
-       if [ ! -e mods-enabled ]; then \
-         $(MKDIR_P) mods-enabled && \
-         $(LN_S) ../mods-available/compat.conf mods-enabled/; \
+       if [ ! -e features-enabled ]; then \
+         $(MKDIR_P) features-enabled && \
+         $(LN_S) ../features-available/compat.conf features-enabled/; \
        fi
similarity index 68%
rename from etc/icinga2/mods-available/Makefile.am
rename to etc/icinga2/features-available/Makefile.am
index b39bc033ef008395e2dd214cb50028a50bcac82a..91cf2379da6b83ae630ecb8c7ba1fdbaedcdbf39 100644 (file)
@@ -1,8 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-icinga2confdir = $(sysconfdir)/icinga2/mods-available
-icinga2conf_DATA = \
-       compat.load
+icinga2confdir = $(sysconfdir)/icinga2/features-available
 
 CONFIG_FILES = \
        compat.conf
@@ -15,4 +13,4 @@ install-data-local:
        fi; \
        done
 
-EXTRA_DIST = $(CONFIG_FILES) $(icinga2conf_DATA)
+EXTRA_DIST = $(CONFIG_FILES)
similarity index 94%
rename from etc/icinga2/mods-available/compat.conf
rename to etc/icinga2/features-available/compat.conf
index 2c636f33fe83986fe9f964e353ae3db944af4fc8..c7ed7cbcc8861ce7f07eb3bd9e299b11b41df9fe 100644 (file)
@@ -4,7 +4,7 @@
  * hosts and services. CompatLog writeis the Icinga 1.x icinga.log and archives.
  */
 
-include "compat.load"
+library "compat"
 
 object StatusDataWriter "status" { }
 object ExternalCommandListener "command" { }
diff --git a/etc/icinga2/mods-available/compat.load b/etc/icinga2/mods-available/compat.load
deleted file mode 100644 (file)
index f99df2f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-library "compat"
-
index 5d21b1d6e6bab46b9f9b9ef5251f300beaac22de..4b32a8255187156f95bf5a0b3dae808282718b67 100644 (file)
@@ -1,11 +1,10 @@
 SUBDIRS = \
                  mkembedconfig
 
-bin_SCRIPTS = i2modconf
+bin_SCRIPTS = i2enfeature
 CLEANFILES = $(bin_SCRIPTS)
 
-EXTRA_DIST = i2modconf.in
+EXTRA_DIST = i2enfeature.in
 
 install-exec-hook:
-       $(LN_S) -f i2modconf $(bindir)/i2enmod
-       $(LN_S) -f i2modconf $(bindir)/i2dismod
+       $(LN_S) -f i2enfeature $(bindir)/i2disfeature
diff --git a/tools/i2enfeature.in b/tools/i2enfeature.in
new file mode 100644 (file)
index 0000000..a83b1a1
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/sh
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+sbindir=@sbindir@
+bindir=@bindir@
+sysconfdir=@sysconfdir@
+localstatedir=@localstatedir@
+
+ICINGA2CONFDIR=@sysconfdir@/icinga2
+
+TOOL=$(basename -- $0)
+
+if [ "$TOOL" != "i2enfeature" -a "$TOOL" != "i2disfeature" ]; then
+       echo "Invalid tool name ($TOOL). Should be 'i2enfeature' or 'i2disfeature'."
+       exit 1
+fi
+
+if [ -z "$1" ]; then
+       echo "Syntax: $0 <feature>"
+
+       if [ "$TOOL" = "i2enfeature" ]; then
+               echo "Enables the specified feature."
+       else
+               echo "Disables the specified feature."
+       fi
+
+       echo
+       echo -n "Available feature: "
+
+       for file in $ICINGA2CONFDIR/mods-available/*.conf; do
+               echo -n $(basename -- $file .conf)
+       done
+
+       echo
+
+       exit 1
+fi
+
+FEATURE=$1
+
+if [ ! -e $ICINGA2CONFDIR/mods-available/$FEATURE.conf ]; then
+       echo "The feature '$FEATURE' does not exist."
+       exit 1
+fi
+
+if [ "$TOOL" = "i2enfeature" ]; then
+       if [ -e $ICINGA2CONFDIR/mods-enabled/$FEATURE.conf ]; then
+               echo "The feature '$FEATURE' is already enabled."
+               exit 0
+       fi
+
+       ln -s ../mods-available/$FEATURE.conf $ICINGA2CONFDIR/mods-enabled/
+
+       echo "Module '$FEATURE' was enabled."
+elif [ "$TOOL" = "i2disfeature" ]; then
+       if [ ! -e $ICINGA2CONFDIR/mods-enabled/$FEATURE.conf ]; then
+               echo "The feature '$FEATURE' is already disabled."
+               exit 0
+       fi
+
+       rm -f $ICINGA2CONFDIR/mods-enabled/$FEATURE.conf
+
+       echo "Module '$FEATURE' was disabled."
+fi
+
+echo "Make sure to restart Icinga 2 for these changes to take effect."
+exit 0
diff --git a/tools/i2modconf.in b/tools/i2modconf.in
deleted file mode 100644 (file)
index 48edba1..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-bindir=@bindir@
-sysconfdir=@sysconfdir@
-localstatedir=@localstatedir@
-
-ICINGA2CONFDIR=@sysconfdir@/icinga2
-
-TOOL=$(basename -- $0)
-
-if [ "$TOOL" != "i2enmod" -a "$TOOL" != "i2dismod" ]; then
-       echo "Invalid tool name ($TOOL). Should be 'i2enmod' or 'i2dismod'."
-       exit 1
-fi
-
-if [ -z "$1" ]; then
-       echo "Syntax: $0 <module>"
-
-       if [ "$TOOL" = "i2enmod" ]; then
-               echo "Enables the specified module."
-       else
-               echo "Disables the specified module."
-       fi
-
-       echo
-       echo -n "Available modules: "
-
-       for file in $ICINGA2CONFDIR/mods-available/*.conf; do
-               echo -n $(basename -- $file .conf)
-       done
-
-       echo
-
-       exit 1
-fi
-
-MOD=$1
-
-if [ ! -e $ICINGA2CONFDIR/mods-available/$MOD.conf ]; then
-       echo "The module '$MOD' does not exist."
-       exit 1
-fi
-
-if [ "$TOOL" = "i2enmod" ]; then
-       if [ -e $ICINGA2CONFDIR/mods-enabled/$MOD.conf ]; then
-               echo "The module '$MOD' is already enabled."
-               exit 0
-       fi
-
-       ln -s ../mods-available/$MOD.conf $ICINGA2CONFDIR/mods-enabled/
-
-       echo "Module '$MOD' was enabled."
-elif [ "$TOOL" = "i2dismod" ]; then
-       if [ ! -e $ICINGA2CONFDIR/mods-enabled/$MOD.conf ]; then
-               echo "The module '$MOD' is already disabled."
-               exit 0
-       fi
-
-       rm -f $ICINGA2CONFDIR/mods-enabled/$MOD.conf
-
-       echo "Module '$MOD' was disabled."
-fi
-
-echo "Make sure to restart Icinga 2 for these changes to take effect."
-exit 0