title: get remote ip of address in a value for use in shell script
body: <p>I am using a CentOS server, and i want to get a remote dynamic ip in a value to use in a script.
  Right now the script gets the ip like this: </p>
  
  <pre><code>    current_ip=$(curl --silent http://ipecho.net/plain)
  </code></pre>
  
  <p>but since i am moving the script to a server, i need it to ping my dyndns domain name and get my ip since its going to be changing every now and then.
  Is there a way to do this with ping or something ?
  So i can add in current_ip my ip every time the script executes ? 
  -Thanks</p>