Skip to content
  • Hi, good job! I look on https://ipinfo.io and if you try curl https://ipinfo.io/$IP/geo you get JSON data back. Therefore you can try use jq and try somthing like this ARR1=($(curl -s https://ipinfo.io/1.1.1.1/geo | jq '.[]')); CITY="${ARR1[1]//\"/}" etc

  • or

    eval declare -A example=($(curl -s https://ipinfo.io/1.1.1.1/geo | jq -r '. | to_entries[] | "[\"\(.key)\"]=\"\(.value)\""'))
    CITY="${example[city]}"
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment