Skip to content

Commit

Permalink
Merge pull request #283 from ikubetoomuzik/master
Browse files Browse the repository at this point in the history
fixed weather app showing "Location Unavailable"
  • Loading branch information
ethancedwards8 authored Sep 3, 2024
2 parents 71f1ce6 + b6e5536 commit 415927f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/weather.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ display_weather()
temperature=$(echo $weather_information | rev | cut -d ' ' -f 1 | rev) # +31°C, -3°F, etc
unicode=$(forecast_unicode $weather_condition)

echo "$unicode${temperature/+/}" # remove the plus sign to the temperature
echo "$unicode ${temperature/+/}" # remove the plus sign to the temperature
}

forecast_unicode()
Expand All @@ -69,7 +69,7 @@ forecast_unicode()
main()
{
# process should be cancelled when session is killed
if ping -q -c 1 -W 1 ipinfo.io &>/dev/null; then
if (echo > /dev/tcp/ipinfo.io/443) >/dev/null 2>&1; then
echo "$(display_weather)$(display_location)"
else
echo "Location Unavailable"
Expand Down

0 comments on commit 415927f

Please sign in to comment.