title: How to get the IP address of a server using bash
body: <p>GOAL: 
  Pull the IP address from the server. However, the issue comes into play that dedicated and VPS are very different. What is the best or most ideal way to pull and do a check and print the IP Address?</p>
  
  <p>I guess I could do a check with the following?</p>
  
  <pre><code>root@host]# /sbin/ifconfig venet0:0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'
  IP IS HERE
  root@host]# /sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'
  eth0: error fetching interface information: Device not found
  </code></pre>