Getting the current IP from the command line
I would use a different service that provides output in a format that is good for tools (not humans (html is for displaying for humans)).

Hit this url:

https://ifconfig.co/json


You're output looks like this:

{
  "ip": "154.140.296.288",
  "ip_decimal": 926648668,
  "country": "United States",
  "city": "Seattle",
  "hostname": "154-140-296-288.Bob.com"
}


Which is obviously json which can be parsed using the jq tool.

&gt; curl -s https://ifconfig.co/json  | jq .ip -r
154.140.296.188