-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
treehouses internet reverse
refactor (fixes #2137)
#2140
Conversation
ip=$(echo "$info" | grep -e '"ip": "') | ||
org=$(echo "$info" | grep -e '"org": "') | ||
country=$(echo "$info" | grep -o '"country": "[^;]*') | ||
city=$(echo $info | grep -o '"city": "[^;]*' | cut -d '"' -f 4) | ||
postal=$(echo $info | grep -o '"postal": "[^;]*' | cut -d '"' -f 4) | ||
timezone=$(echo $info | grep -o '"timezone": "[^;]*' | cut -d '"' -f 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like you can trim the grep into jq but with how unreliable jq maybe sometime, it is best to leave it how it is.
modules/internet.sh
Outdated
echo "$ip" | ||
echo "$org" | ||
echo "$country, \"city\": \"$city\", \"postal\": \"$postal\"" | ||
echo "\"timezone\": \"$timezone\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the original, organization and timezone were at the bottom. But this is fine 👍
treehouses internet reverse
reorder and keep unique values (fixes #2137)treehouses internet reverse
refactor (fixes #2137)
No description provided.