Преглед на файлове

- 7TInzidenz_Kreise.sh hinzugefügt

erdoking преди 4 години
родител
ревизия
99c1b34026
променени са 1 файла, в които са добавени 54 реда и са изтрити 0 реда
  1. 54 0
      corona/7TInzidenz_Kreise.sh

+ 54 - 0
corona/7TInzidenz_Kreise.sh

@@ -0,0 +1,54 @@
+#!/bin/bash
+
+FILES="Impfquotenmonitoring.xlsx Fallzahlen_Archiv.xlsx"
+
+echo -e "Version: 1.6.0p7\nAgentOS: linux\nHostname: 7TInzidenz_Kreise\n\n<<<local>>>"
+
+## wir werten die offiziellen Daten aus
+for FILE in ${FILES}
+do 
+
+      ## cleanup
+      [ -f /tmp/${FILE} ] && rm -f /tmp/${FILE}
+      [ -f /tmp/${FILE}.txt ] && rm -f /tmp/${FILE}.txt
+
+      URL="https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/${FILE}?__blob=publicationFile"
+      wget --quiet -O /tmp/${FILE} ${URL}
+done
+
+
+
+## entweder von heute oder von gestern
+python3  /opt/github/xlsx2csv/xlsx2csv.py /tmp/Fallzahlen_Archiv.xlsx /tmp/Fallzahlen_Archiv.txt -n"$(date +'%d.%m.%Y')" 2>/dev/null|| \
+python3  /opt/github/xlsx2csv/xlsx2csv.py /tmp/Fallzahlen_Archiv.xlsx /tmp/Fallzahlen_Archiv.txt -n"$(date --date="yesterday" +'%d.%m.%Y')" || exit 99
+
+
+egrep '^LK|^SK|^Region|^StadtRegion' /tmp/Fallzahlen_Archiv.txt |while read line #Landkreis LKNR Anzahl Inzidenz
+do
+        Landkreis=`echo ${line} | cut -d',' -f1`
+        ## Nicht benötigt
+        LKNR=`echo ${line} | cut -d',' -f2`
+        ## Gemeint: gemeldete Infektionen in 7 Tagen
+        Anzahl=`echo ${line} | cut -d',' -f3`
+        ## Inzidenz wird gerundet
+        Inzidenz=`echo ${line} | cut -d',' -f4 | sed 's/,/./g' | awk '{printf("%d\n",$1 + 0.5)}'`
+
+        ## Berenigte Werte für die Ausgabe
+        LandkreisB=`echo ${Landkreis} | sed 's/ /_/g'`
+
+        ## Orientiert an der Ministerkonferenz vom 11.02.2021 
+        if [ ${Inzidenz} -ge 50 ]
+        then
+                STATE=2
+        ## und gewarnt wird "erst" ab 50
+        elif [ ${Inzidenz} -ge 35 ]
+        then
+                STATE=1
+        else
+                STATE=0
+        fi
+
+        echo "${STATE} ${LandkreisB} Inzidenz=${Inzidenz}|gemeldetenFaelle7Tage=${Anzahl} 7-Tage-Inzidenz: ${Inzidenz} gemeldetenFaelle7Tage: ${Anzahl}" 
+
+done
+