change if statement to case (#1137)
This commit is contained in:
parent
688ea20708
commit
f25687ad78
1 changed files with 7 additions and 10 deletions
|
@ -251,16 +251,13 @@ getdoppler() {
|
||||||
cont="$(sed "s/,.*//" "$radarloc")"
|
cont="$(sed "s/,.*//" "$radarloc")"
|
||||||
loc="$(cut -c 4- "$radarloc")"
|
loc="$(cut -c 4- "$radarloc")"
|
||||||
notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc."
|
notify-send "🌦️ Doppler RADAR" "Pulling most recent Doppler RADAR for $loc."
|
||||||
if [ "$cont" = "US" ] ; then
|
case "$cont" in
|
||||||
curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;
|
"US") curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;;
|
||||||
elif [ "$cont" = "EU" ] ; then
|
"EU") curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ;;
|
||||||
curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ;
|
"AF") curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ;;
|
||||||
elif [ "$cont" = "AF" ] ; then
|
"DE") loc="$(echo "$loc" | tr "[:upper:]" "[:lower:]")"
|
||||||
curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ;
|
curl -sL "https://www.dwd.de/DWD/wetter/radar/radfilm_${loc}_akt.gif" > "$doppler" ;;
|
||||||
elif [ "$cont" = "DE" ] ; then
|
esac
|
||||||
loc="$(echo "$loc" | tr "[:upper:]" "[:lower:]")"
|
|
||||||
curl -sL "https://www.dwd.de/DWD/wetter/radar/radfilm_${loc}_akt.gif" > "$doppler" ;
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" ;}
|
showdoppler() { setsid -f mpv --no-osc --loop=inf --no-terminal "$doppler" ;}
|
||||||
|
|
Loading…
Reference in a new issue