Explorar el Código

fix for null traffic data

Serghey Rodin hace 13 años
padre
commit
405cd4bdb1
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      bin/v-update-web-domains-traff

+ 3 - 1
bin/v-update-web-domains-traff

@@ -45,7 +45,9 @@ for domain in $(search_objects 'web' 'SUSPENDED' "no" 'DOMAIN'); do
     while read line; do
     while read line; do
         if  [[ "$line" =~ ^[0-9]+$ ]]; then
         if  [[ "$line" =~ ^[0-9]+$ ]]; then
             line=${line#0}
             line=${line#0}
-            bytes=$(($bytes + $line))
+            if [ ! -z "$line" ]; then
+                bytes=$(($bytes + $line))
+            fi
         fi
         fi
     done < $log_file
     done < $log_file