diff --git a/roles/wttr/files/wttr.sh b/roles/wttr/files/wttr.sh index 272cfaf..11d260d 100755 --- a/roles/wttr/files/wttr.sh +++ b/roles/wttr/files/wttr.sh @@ -4,9 +4,9 @@ location="$1" if [ -z "$1" ]; then location_data=$(curl -s http://ip-api.com/json) - location=$(echo "$location_data" | jq -r 'if (.zip | length) != 0 then .zip else .city end') lat=$(echo "$location_data" | jq '.lat') lon=$(echo "$location_data" | jq '.lon') + location=$lat,$lon country=$(echo "$location_data" | jq -r '.country') fi