Selaa lähdekoodia

fix for null values

Serghey Rodin 13 vuotta sitten
vanhempi
sitoutus
23bed9ed19
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      bin/v-update-web-domain-traff

+ 3 - 3
bin/v-update-web-domain-traff

@@ -45,12 +45,12 @@ bytes=0
 
 # Parsing log
 while read line; do
-
     if  [[ "$line" =~ ^[0-9]+$ ]]; then
         line=${line#0}
-        bytes=$(($bytes + $line))
+        if [ ! -z "$line" ]; then
+            bytes=$(($bytes + $line))
+        fi
     fi
-
 done < $log_file
 
 # Converting to Mb