mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Beautifying the bash
This commit is contained in:
parent
e817c34644
commit
454d21b082
@ -2,16 +2,16 @@
|
|||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# Author: Alexander Epstein https://github.com/alexanderepstein
|
||||||
getWeather()
|
getWeather()
|
||||||
{
|
{
|
||||||
country=$(curl -s ipinfo.io/country) > /dev/null
|
country=$(curl -s ipinfo.io/country) > /dev/null
|
||||||
if [ $country = "US" ];then
|
if [ $country = "US" ];then
|
||||||
city=$(curl -s ipinfo.io/city) > /dev/null
|
city=$(curl -s ipinfo.io/city) > /dev/null
|
||||||
region=$(curl -s ipinfo.io/region) > /dev/null
|
region=$(curl -s ipinfo.io/region) > /dev/null
|
||||||
region=$(echo "$region" | tr -dc '[:upper:]')
|
region=$(echo "$region" | tr -dc '[:upper:]')
|
||||||
curl wttr.in/$city,$region
|
curl wttr.in/$city,$region
|
||||||
else
|
else
|
||||||
location=$(curl -s ipinfo.io/loc) > /dev/null
|
location=$(curl -s ipinfo.io/loc) > /dev/null
|
||||||
curl wttr.in/$location
|
curl wttr.in/$location
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
checkInternet()
|
checkInternet()
|
||||||
|
Loading…
Reference in New Issue
Block a user