2 ICINGA2CONFDIR=@CMAKE_INSTALL_FULL_SYSCONFDIR@/icinga2
6 if [ "$TOOL" != "icinga2-enable-feature" -a "$TOOL" != "icinga2-disable-feature" ]; then
7 echo "Invalid tool name ($TOOL). Should be 'icinga2-enable-feature' or 'icinga2-disable-feature'."
12 echo "Syntax: $0 <feature>"
14 if [ "$TOOL" = "icinga2-enable-feature" ]; then
15 echo "Enables the specified feature."
17 echo "Disables the specified feature."
21 echo -n "Available features: "
23 for file in $ICINGA2CONFDIR/features-available/*.conf; do
24 echo -n "$(basename -- $file .conf) "
34 if [ ! -e $ICINGA2CONFDIR/features-available/$FEATURE.conf ]; then
35 echo "The feature '$FEATURE' does not exist."
39 if [ "$TOOL" = "icinga2-enable-feature" ]; then
40 if [ -e $ICINGA2CONFDIR/features-enabled/$FEATURE.conf ]; then
41 echo "The feature '$FEATURE' is already enabled."
45 ln -s ../features-available/$FEATURE.conf $ICINGA2CONFDIR/features-enabled/
47 echo "Module '$FEATURE' was enabled."
48 elif [ "$TOOL" = "icinga2-disable-feature" ]; then
49 if [ ! -e $ICINGA2CONFDIR/features-enabled/$FEATURE.conf ]; then
50 echo "The feature '$FEATURE' is already disabled."
54 rm -f $ICINGA2CONFDIR/features-enabled/$FEATURE.conf
56 echo "Module '$FEATURE' was disabled."
59 echo "Make sure to restart Icinga 2 for these changes to take effect."