Skip to content

Instantly share code, notes, and snippets.

@jjrh
Created March 19, 2020 15:53
Show Gist options
  • Save jjrh/bd9f876834184c42bccee17795757e6c to your computer and use it in GitHub Desktop.
Save jjrh/bd9f876834184c42bccee17795757e6c to your computer and use it in GitHub Desktop.
show corona-stats from https://corona-stats.online every hour (change timedelay to be longer) ARG1 is country code. Empty arg is world stats. Ie: ./stats.sh CA
#!/bin/bash
x=1
inf=0
timedelay=3600
COUNTRY_CODE="$1"
while [ $inf -le 1 ]; do
clear
sleep 0.5
curl "https://corona-stats.online/$COUNTRY_CODE"
x=1
while [ $x -le $timedelay ]
do
printf "\033[K"
printf "\033[10D"
printf "$x/$timedelay"
sleep 1
x=$(( $x + 1 ))
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment