<?xml version="1.0" encoding="UTF-8"?>
<trick>
  <category-id type="integer">1</category-id>
  <comments type="integer">#&lt;Comment:0x2b3b71640fa0&gt;#&lt;Comment:0x2b3b716407f8&gt;#&lt;Comment:0x2b3b71640758&gt;</comments>
  <content>&lt;h2&gt;Solution 1: wget and whatsmyip.com&lt;/h2&gt;


&lt;pre&gt;
&lt;code&gt;
#!/bin/sh
IP=`wget -q -O - http://whatismyip.com/automation/n09230945.asp`
echo $IP
&lt;/code&gt;
&lt;/pre&gt;

	&lt;h2&gt;Solution 2: wget and freeshell.org&lt;/h2&gt;


&lt;pre&gt;
&lt;code&gt;
#!/bin/sh
IP=$( wget -qO - http://cfaj.freeshell.org/ipaddr.cgi )
echo $IP
&lt;/code&gt;
&lt;/pre&gt;

	&lt;h2&gt;Solution 3: lynx and freeshell.org&lt;/h2&gt;


&lt;pre&gt;
&lt;code&gt;
#!/bin/sh
IP=$( lynx -dump http://cfaj.freeshell.org/ipaddr.cgi )
echo $IP
&lt;/code&gt;
&lt;/pre&gt;</content>
  <content-bbcode nil="true"></content-bbcode>
  <content-format>Textile</content-format>
  <content-html nil="true"></content-html>
  <content-textile>h2. Solution 1: wget and whatsmyip.com

&lt;pre&gt;
&lt;code&gt;
#!/bin/sh
IP=`wget -q -O - http://whatismyip.com/automation/n09230945.asp`
echo $IP
&lt;/code&gt;
&lt;/pre&gt;


h2. Solution 2: wget and freeshell.org

&lt;pre&gt;
&lt;code&gt;
#!/bin/sh
IP=$( wget -qO - http://cfaj.freeshell.org/ipaddr.cgi )
echo $IP
&lt;/code&gt;
&lt;/pre&gt;


h2. Solution 3: lynx and freeshell.org

&lt;pre&gt;
&lt;code&gt;
#!/bin/sh
IP=$( lynx -dump http://cfaj.freeshell.org/ipaddr.cgi )
echo $IP
&lt;/code&gt;
&lt;/pre&gt;</content-textile>
  <created-at type="datetime">2008-06-21T17:10:46+02:00</created-at>
  <creator-id type="integer">1</creator-id>
  <deleted-at type="datetime" nil="true"></deleted-at>
  <file nil="true"></file>
  <id type="integer">278</id>
  <lang-id type="integer" nil="true"></lang-id>
  <locale>en</locale>
  <nreports type="integer">0</nreports>
  <nvotes type="integer">8</nvotes>
  <permalink>get_the_external_ip_of_your_router_on_the_command_line</permalink>
  <published-at type="datetime">2008-06-21T16:32:47+02:00</published-at>
  <state>published</state>
  <summary>Sometimes you want to write a script that needs the external IP of the router your client is connected to. Here are three possible solutions.</summary>
  <title>Get the external IP of your router on the command line</title>
  <updated-at type="datetime">2008-06-25T03:18:46+02:00</updated-at>
  <updater-id type="integer">84</updater-id>
  <url nil="true"></url>
  <url-code nil="true"></url-code>
</trick>
