]> granicus.if.org Git - icinga2/commitdiff
Implement init script option: checkconfig.
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 25 Sep 2013 10:42:53 +0000 (12:42 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 25 Sep 2013 10:42:53 +0000 (12:42 +0200)
etc/init.d/icinga2.in

index f123366fad15842889fd806b20cc84bcebbffe34..68ebacc6f6960c62261fdb3f82e47940510776e0 100644 (file)
@@ -103,6 +103,13 @@ reload() {
        fi
 }
 
+# Check the Icinga 2 configuration
+checkconfig() {
+       printf "Checking configuration:"
+
+       echo "Validating the configuration file:"
+       exec $DAEMON -c $ICINGA2_CONFIG_FILE -C
+}
 
 # Print status for Icinga 2
 status() {
@@ -131,11 +138,14 @@ case "$1" in
         stop
         start
         ;;
-reload)
+  reload)
        reload
        ;;
+  checkconfig)
+       checkconfig
+       ;;
   *)
-        echo $"Usage: $0 {start|stop|restart|status}"
+        echo $"Usage: $0 {start|stop|restart|reload|checkconfig|status}"
         exit 1
 esac
 exit 0