Process Unknown location in weather

This commit is contained in:
Pavel Korytov 2020-08-08 21:39:06 +03:00
parent ab4aadffa7
commit 587d6edb6a

View file

@ -7,6 +7,9 @@ format_2=${FORMAT_1:-"format=v2n"}
bar_weather=$(curl -s wttr.in/${location}?format=${bar_format} || echo "??")
if [ -z ${bar_weather} ]; then
exit 1
elif [[ ${bar_weather} == *"Unknown"* ]]; then
echo "??"
exit 1
fi
echo ${bar_weather}