[omd-commits] OMD Git: omd: nagvis: NAGVIS_URLS hook is skipped when config directory does not exist

git version control git at mathias-kettner.de
Wed Apr 18 09:46:08 CEST 2012


Module:   omd
Branch:   master
Commit:   508aa43585fe8c2fd22ca3819e4088d220cd133b
URL:      http://omdistro.org/projects/omd/repository/revisions/508aa43585fe8c2fd22ca3819e4088d220cd133b

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Wed Apr 18 09:46:05 2012 +0200
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Wed Apr 18 09:46:05 2012 +0200

nagvis: NAGVIS_URLS hook is skipped when config directory does not exist

---

 packages/nagvis/NAGVIS_URLS.hook |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/packages/nagvis/NAGVIS_URLS.hook b/packages/nagvis/NAGVIS_URLS.hook
index ad61a87..cf59ef5 100755
--- a/packages/nagvis/NAGVIS_URLS.hook
+++ b/packages/nagvis/NAGVIS_URLS.hook
@@ -31,6 +31,11 @@ case "$1" in
         echo "none: disable"
     ;;
     set)
+        # Skip this hook when NagVis configuration directory does not exist
+        if [ ! -d $OMD_ROOT/etc/nagvis ]; then
+            exit 0
+        fi
+
         CFG_FILE=$OMD_ROOT/etc/nagvis/conf.d/urls.ini.php
         GUI=$2
         if [ "$GUI" == "auto" ]; then
@@ -45,7 +50,7 @@ case "$1" in
         fi
 
         if [ ! -d $OMD_ROOT/etc/nagvis/conf.d ]; then
-            mkdir $OMD_ROOT/etc/nagvis/conf.d
+            mkdir -p $OMD_ROOT/etc/nagvis/conf.d
         fi
         
         if [ "$GUI" == "check_mk" ]; then



More information about the omd-commits mailing list