Make sb-doppler POSIX compliant

This commit is contained in:
krisdoodle45 2022-02-17 18:14:42 +01:00 committed by GitHub
parent c16d6fd3b0
commit c2f25befa9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -232,14 +232,14 @@ radarcode=$(echo "$chosen" | sed "s/..: // ; s/:.*//")
echo "$radarcode" | grep -q "^[A-Z]\+$" && printf "%s,%s\\n" "$continentcode" "$radarcode" > "$radarloc" ;} echo "$radarcode" | grep -q "^[A-Z]\+$" && printf "%s,%s\\n" "$continentcode" "$radarcode" > "$radarloc" ;}
getdoppler() { getdoppler() {
cont="$(cat "$radarloc" | sed "s/,.*//")" cont="$(sed "s/,.*//" "$radarloc")"
loc="$(cat "$radarloc" | cut -c 4-)" 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 if [ "$cont" = "US" ] ; then
curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ; curl -sL "https://radar.weather.gov/ridge/lite/${loc}_loop.gif" > "$doppler" ;
elif [ $cont == "EU" ] ; then elif [ "$cont" = "EU" ] ; then
curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ; curl -sL "https://api.sat24.com/animated/${loc}/rainTMC/2/" > "$doppler" ;
elif [ $cont == "AF" ] ; then elif [ "$cont" = "AF" ] ; then
curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ; curl -sL "https://api.sat24.com/animated/${loc}/rain/2/" > "$doppler" ;
fi fi
} }