change if statement to case

This commit is contained in:
i-c-u-p 2022-07-05 16:35:18 -05:00
parent 688ea20708
commit 8509e4bcbd
No known key found for this signature in database
GPG Key ID: ABB80C12170FC0D1

View File

@ -251,16 +251,13 @@ getdoppler() {
cont="$(sed "s/,.*//" "$radarloc")"
loc="$(cut -c 4- "$radarloc")"
notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc."
if [ "$cont" = "US" ] ; then
curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;
elif [ "$cont" = "EU" ] ; then
curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ;
elif [ "$cont" = "AF" ] ; then
curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ;
elif [ "$cont" = "DE" ] ; then
loc="$(echo "$loc" | tr "[:upper:]" "[:lower:]")"
curl -sL "https://www.dwd.de/DWD/wetter/radar/radfilm_${loc}_akt.gif" > "$doppler" ;
fi
case "$cont" in
"US") curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;;
"EU") curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ;;
"AF") curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ;;
"DE") loc="$(echo "$loc" | tr "[:upper:]" "[:lower:]")"
curl -sL "https://www.dwd.de/DWD/wetter/radar/radfilm_${loc}_akt.gif" > "$doppler" ;;
esac
}
showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" ;}