Skip to content

Commit

Permalink
internet reverse reorder and keep unique (fixes #2137)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLKwong committed Mar 26, 2021
1 parent 79e5dc7 commit b6fdd80
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/internet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ function internet {
log_and_exit1 "Error: no internet found"
fi
info="$(curl -s ipinfo.io | grep -o '"[^"]*"\s*:\s*"[^"]*"')"
ip=$(echo "$info" | grep -E '"(ip)"')
org=$(echo "$info" | grep -E '"(org)"')
country=$(echo "$info" | grep -E '"(country)"')
city=$(echo $info | grep -E '"(city)"')
postal=$(echo $postal | grep -E '"(postal)"')
timezone=$(echo $postal | grep -E '"(timezone)"')
ip=$(echo "$info" | grep -e '"(ip)"')
org=$(echo "$info" | grep -e '"(org)"')
country=$(echo "$info" | grep -e '"(country)"')
city=$(echo $info | grep -e '"(city)"')
postal=$(echo $postal | grep -e '"(postal)"')
timezone=$(echo $postal | grep -e '"(timezone)"')

echo " IP: $ip"
echo " ORG: $org"
Expand Down

0 comments on commit b6fdd80

Please sign in to comment.