Beautifying the bash

This commit is contained in:
Alex Epstein 2017-06-26 23:18:18 -04:00
parent e817c34644
commit 454d21b082
3 changed files with 14 additions and 14 deletions

View File

@ -2,16 +2,16 @@
# Author: Alexander Epstein https://github.com/alexanderepstein
getWeather()
{
country=$(curl -s ipinfo.io/country) > /dev/null
if [ $country = "US" ];then
country=$(curl -s ipinfo.io/country) > /dev/null
if [ $country = "US" ];then
city=$(curl -s ipinfo.io/city) > /dev/null
region=$(curl -s ipinfo.io/region) > /dev/null
region=$(echo "$region" | tr -dc '[:upper:]')
curl wttr.in/$city,$region
else
else
location=$(curl -s ipinfo.io/loc) > /dev/null
curl wttr.in/$location
fi
fi
}
checkInternet()