diff --git a/konata.sh b/konata.sh index 6189233..1b0b01b 100755 --- a/konata.sh +++ b/konata.sh @@ -87,9 +87,15 @@ cv(){ cases=$(jq -r '.todayCases' <<< $stats) pm=$(jq -r '.testsPerOneMillion' <<< $stats) pct=$(echo "scale = 2; $pm / 10000" | bc) + if [ "$cases" == "0" ] + then + updated="Perhaps the stats are not updated yet?" + fi if jq -re '.country' <<< $stats then - sendmsg "Today's COVID-19 cases for $country: $cases \($pct% of the population tested\). Stay safe!" + sendmsg "Today's COVID-19 cases for $country: $cases \($pct% of the population tested\). Stay safe! + Queried at $(date +'%Y-%m-%d %H:%M') CET. + $updated" else sendmsg "This country doesn't have any stats!" fi