[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a

David GUENAULT dguenault at monitoring-fr.org
Tue Feb 28 22:21:21 UTC 2012


The following commit has been merged in the debian/master branch:
commit f04ff5df7fcd571bf85d3a5f375cb0ac98be5e9b
Author: David GUENAULT <dguenault at monitoring-fr.org>
Date:   Thu Feb 16 18:47:20 2012 +0100

    FIX error message in logs compression when archives folder is empty

diff --git a/contrib/alternative-installation/shinken-install/shinken.sh b/contrib/alternative-installation/shinken-install/shinken.sh
index 650d3d6..d3fc537 100755
--- a/contrib/alternative-installation/shinken-install/shinken.sh
+++ b/contrib/alternative-installation/shinken-install/shinken.sh
@@ -709,7 +709,6 @@ function supdate(){
 ##############################
 
 function compresslogs(){
-    trap 'trap_handler ${LINENO} $? compresslogs' ERR
     cadre "Compress rotated logs" green
     if [ ! -d $TARGET/var/archives ]
     then
@@ -717,16 +716,19 @@ function compresslogs(){
         exit 0
     fi
     cd $TARGET/var/archives
-    for l in $(ls -1 ./*.log)
-    do
-        file=$(basename $l)
-        if [ -e $file ]
-        then
-            cecho " > Processing $file" green
-            tar czf $file.tar.gz $file
-            rm -f $file
-        fi
-    done
+    if [ ! -z "$(ls)" ]
+    then
+        for l in $(ls ./*.log)
+        do
+            file=$(basename $l)
+            if [ -e $file ]
+            then
+                cecho " > Processing $file" green
+                tar czf $file.tar.gz $file
+                rm -f $file
+            fi
+        done
+    fi
 }
 
 function shelp(){

-- 
UNNAMED PROJECT



More information about the Pkg-nagios-changes mailing list