[icinga-checkins] icinga.org: icinga-core/rdarrud/cgis: improve output of init-script

git at icinga.org git at icinga.org
Thu Sep 16 21:46:42 CEST 2010


Module: icinga-core
Branch: rdarrud/cgis
Commit: 2986bd23888203c349c872b5a68f9059cc7dc0a4
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=2986bd23888203c349c872b5a68f9059cc7dc0a4

Author: Christoph Maser <cmr at financial.com>
Date:   Sun Jul 25 00:42:04 2010 +0200

improve output of init-script

---

 daemon-init-redhat.in |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/daemon-init-redhat.in b/daemon-init-redhat.in
index 836d8aa..6e456f4 100644
--- a/daemon-init-redhat.in
+++ b/daemon-init-redhat.in
@@ -68,10 +68,12 @@ force_reload() {
 check_config() {
         $nice runuser -s /bin/bash - $user -c "$corelimit >/dev/null 2>&1 ; $exec -v $config > /dev/null 2>&1"
 	RETVAL=$?
-	if [ $RETVAL -ne 0 ] ; then
-		echo "Configuration error: please check the config by runing \"$exec -v $config\""
-		exit 1
-	fi
+        if [ $RETVAL -ne 0 ] ; then
+                echo -n $"Configuration validation failed"
+                failure
+                echo
+                exit 1
+        fi
 }
 
 case "$1" in
@@ -104,7 +106,10 @@ case "$1" in
         restart
         ;;
    configtest)
-	check_config
+        echo -n  $"Checking config for $prog: "
+        check_config && success
+        echo
+
 	;;
     *)
         echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"





More information about the icinga-checkins mailing list