<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: OpenDNS Dynamic IP Update Script through Linux</title>
	<atom:link href="http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/</link>
	<description>Bringing out the geekiness in all of us</description>
	<lastBuildDate>Mon, 18 Jan 2010 08:21:30 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Robert</title>
		<link>http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/comment-page-1/#comment-989</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Sun, 11 Oct 2009 22:26:09 +0000</pubDate>
		<guid isPermaLink="false">http://bassmadrigal.com/blog/?p=7#comment-989</guid>
		<description>hi Jeremy,
I&#039;m new to OpenDNS filtering and this is awesome service, wish I knew about this earlier.

Find this post from your comment(s) on OpenDNS forum first...and since I&#039;m running Jaunty full-time at home 
,my search for an desktop updater led me to &quot;ddclient&quot; and &quot;Inadyn&quot;, I installed both.

so my question is....is the purpose of your script here basically the same as those 2 ready-made packages ?

thanks</description>
		<content:encoded><![CDATA[<p>hi Jeremy,<br />
I&#8217;m new to OpenDNS filtering and this is awesome service, wish I knew about this earlier.</p>
<p>Find this post from your comment(s) on OpenDNS forum first&#8230;and since I&#8217;m running Jaunty full-time at home<br />
,my search for an desktop updater led me to &#8220;ddclient&#8221; and &#8220;Inadyn&#8221;, I installed both.</p>
<p>so my question is&#8230;.is the purpose of your script here basically the same as those 2 ready-made packages ?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arfy</title>
		<link>http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/comment-page-1/#comment-931</link>
		<dc:creator>Arfy</dc:creator>
		<pubDate>Sat, 03 Oct 2009 06:21:52 +0000</pubDate>
		<guid isPermaLink="false">http://bassmadrigal.com/blog/?p=7#comment-931</guid>
		<description>edit ... last line should read:

Otherwise write the new IP to /var/public_ip (overwriting, not appending), poll the update openDNS update URL, and if successful, exit.</description>
		<content:encoded><![CDATA[<p>edit &#8230; last line should read:</p>
<p>Otherwise write the new IP to /var/public_ip (overwriting, not appending), poll the update openDNS update URL, and if successful, exit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arfy</title>
		<link>http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/comment-page-1/#comment-930</link>
		<dc:creator>Arfy</dc:creator>
		<pubDate>Sat, 03 Oct 2009 06:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://bassmadrigal.com/blog/?p=7#comment-930</guid>
		<description>Hey, folks!   Wow, this is great, thanks for your contributions!  Especially since openDNS doesn&#039;t have anything of the sort (which, like how really simple is this).   

A couple of thoughts ... I do like having a &quot;current status&quot; file (maybe in /tmp, /var/tmp, or even /dev/shm which is in RAM.)   As far as an ongoing log file, I&#039;m not a fan of that, unless I&#039;m trying to track exactly how often my IP changes.

Without posting code, all I did was to grab my public IP from sourceforge, and compare it to /var/public_ip ... If that file does not exist, create it.  If it does exist, and it matches my current IP, then exit.  Otherwise poll the update openDNS update URL, and if successful, exit.  

-- Nate</description>
		<content:encoded><![CDATA[<p>Hey, folks!   Wow, this is great, thanks for your contributions!  Especially since openDNS doesn&#8217;t have anything of the sort (which, like how really simple is this).   </p>
<p>A couple of thoughts &#8230; I do like having a &#8220;current status&#8221; file (maybe in /tmp, /var/tmp, or even /dev/shm which is in RAM.)   As far as an ongoing log file, I&#8217;m not a fan of that, unless I&#8217;m trying to track exactly how often my IP changes.</p>
<p>Without posting code, all I did was to grab my public IP from sourceforge, and compare it to /var/public_ip &#8230; If that file does not exist, create it.  If it does exist, and it matches my current IP, then exit.  Otherwise poll the update openDNS update URL, and if successful, exit.  </p>
<p>&#8211; Nate</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Quincie</title>
		<link>http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/comment-page-1/#comment-912</link>
		<dc:creator>Quincie</dc:creator>
		<pubDate>Sat, 26 Sep 2009 22:54:49 +0000</pubDate>
		<guid isPermaLink="false">http://bassmadrigal.com/blog/?p=7#comment-912</guid>
		<description>Thanks for the awesome post, it helped me out a lot.</description>
		<content:encoded><![CDATA[<p>Thanks for the awesome post, it helped me out a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/comment-page-1/#comment-480</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Thu, 11 Jun 2009 16:21:50 +0000</pubDate>
		<guid isPermaLink="false">http://bassmadrigal.com/blog/?p=7#comment-480</guid>
		<description>That is a really good point. I didn&#039;t think about it after the IP had changed. And I edited your post to reflect the greater than symbols. Sometimes I hate the whole WYSIWYG, but I haven&#039;t found anything better for displaying code in wordpress.</description>
		<content:encoded><![CDATA[<p>That is a really good point. I didn&#8217;t think about it after the IP had changed. And I edited your post to reflect the greater than symbols. Sometimes I hate the whole WYSIWYG, but I haven&#8217;t found anything better for displaying code in wordpress.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Beach</title>
		<link>http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/comment-page-1/#comment-478</link>
		<dc:creator>Beach</dc:creator>
		<pubDate>Thu, 11 Jun 2009 04:46:02 +0000</pubDate>
		<guid isPermaLink="false">http://bassmadrigal.com/blog/?p=7#comment-478</guid>
		<description>The code tags above changed the actual code above, please replace &#039;&gt;&gt;&#039; with &#039;&gt;&gt;&#039;

-Beach</description>
		<content:encoded><![CDATA[<p>The code tags above changed the actual code above, please replace &#8216;&gt;&gt;&#8217; with &#8216;&gt;&gt;&#8217;</p>
<p>-Beach</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Beach</title>
		<link>http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/comment-page-1/#comment-477</link>
		<dc:creator>Beach</dc:creator>
		<pubDate>Thu, 11 Jun 2009 04:31:48 +0000</pubDate>
		<guid isPermaLink="false">http://bassmadrigal.com/blog/?p=7#comment-477</guid>
		<description>Responding to this thread a little late, but wanted to post a message regarding the bash script above..  Seems to me that Sergi has the best approach, but unless we put the new IP in the &#039;$oldip&#039; variable when the IP changes, &#039;$oldip != $newip&#039; will always be true and will send an update on every loop.  I have updated the code and re-added the log for anyone interested.

&lt;pre lang=&quot;bash&quot;&gt;
#!/bin/bash

username=your_opendns_username
passwd=your_opendns_password
log_dir=/home/some_user_dir/.opendns

if [ ! -d $log_dir ]; then
  mkdir $log_dir
fi

if [ -e $log_dir/log ]; then
  mv $log_dir/log $log_dir/log.1
fi

date &gt;&gt; $log_dir/log

oldip=`/usr/bin/curl http://nst.sourceforge.net/nst/tools/ip.php -silent -i`

while [ 1 ]
do

  newip=`/usr/bin/curl http://nst.sourceforge.net/nst/tools/ip.php -silent -i`
 
  if [ $oldip != $newip ]
  then
    /usr/bin/curl -i -m 60 -k -u $username:$passwd &#039;https://updates.opendns.com/account/ddns.php?&#039; -silent &gt;&gt; $log_dir/log
    echo -e &quot;\n&quot; &gt;&gt; $log_dir/log
    $oldip = $newip
  fi
 
  sleep 60

done


&lt;/pre&gt;

-Beach</description>
		<content:encoded><![CDATA[<p>Responding to this thread a little late, but wanted to post a message regarding the bash script above..  Seems to me that Sergi has the best approach, but unless we put the new IP in the &#8216;$oldip&#8217; variable when the IP changes, &#8216;$oldip != $newip&#8217; will always be true and will send an update on every loop.  I have updated the code and re-added the log for anyone interested.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">username</span>=your_opendns_username
<span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">passwd</span></span>=your_opendns_password
<span style="color: #007800;">log_dir</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>some_user_dir<span style="color: #000000; font-weight: bold;">/</span>.opendns
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$log_dir</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$log_dir</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$log_dir</span><span style="color: #000000; font-weight: bold;">/</span>log <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$log_dir</span><span style="color: #000000; font-weight: bold;">/</span>log <span style="color: #007800;">$log_dir</span><span style="color: #000000; font-weight: bold;">/</span>log.1
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$log_dir</span><span style="color: #000000; font-weight: bold;">/</span>log
&nbsp;
<span style="color: #007800;">oldip</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>curl http:<span style="color: #000000; font-weight: bold;">//</span>nst.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>nst<span style="color: #000000; font-weight: bold;">/</span>tools<span style="color: #000000; font-weight: bold;">/</span>ip.php <span style="color: #660033;">-silent</span> -i<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">do</span>
&nbsp;
  <span style="color: #007800;">newip</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>curl http:<span style="color: #000000; font-weight: bold;">//</span>nst.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>nst<span style="color: #000000; font-weight: bold;">/</span>tools<span style="color: #000000; font-weight: bold;">/</span>ip.php <span style="color: #660033;">-silent</span> -i<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$oldip</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #007800;">$newip</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
  <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>curl <span style="color: #660033;">-i</span> <span style="color: #660033;">-m</span> <span style="color: #000000;">60</span> <span style="color: #660033;">-k</span> <span style="color: #660033;">-u</span> <span style="color: #007800;">$username</span>:<span style="color: #007800;">$passwd</span> <span style="color: #ff0000;">'https://updates.opendns.com/account/ddns.php?'</span> <span style="color: #660033;">-silent</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$log_dir</span><span style="color: #000000; font-weight: bold;">/</span>log
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$log_dir</span><span style="color: #000000; font-weight: bold;">/</span>log
    <span style="color: #007800;">$oldip</span> = <span style="color: #007800;">$newip</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
  <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">60</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>-Beach</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/comment-page-1/#comment-413</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Mon, 02 Mar 2009 08:24:03 +0000</pubDate>
		<guid isPermaLink="false">http://bassmadrigal.com/blog/?p=7#comment-413</guid>
		<description>Thanks Sergi, it had been a while since I did bash programming, and I had PHP stuck in my mind. I went and edited my last post.</description>
		<content:encoded><![CDATA[<p>Thanks Sergi, it had been a while since I did bash programming, and I had PHP stuck in my mind. I went and edited my last post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergi</title>
		<link>http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/comment-page-1/#comment-412</link>
		<dc:creator>Sergi</dc:creator>
		<pubDate>Sun, 01 Mar 2009 23:27:47 +0000</pubDate>
		<guid isPermaLink="false">http://bassmadrigal.com/blog/?p=7#comment-412</guid>
		<description>Just a pair of corrections in the script (commented):
&lt;pre&gt;
#!/bin/bash
 
username=your_opendns_username
passwd=your_opendns_password
 
while [1]
do
  if [ -z $oldip ] # spaces inside the brackets
  then
  oldip=`/usr/bin/curl http://nst.sourceforge.net/nst/tools/ip.php -silent -i`
  fi
 
  newip=`/usr/bin/curl http://nst.sourceforge.net/nst/tools/ip.php -silent -i` # no $ sign before newip
 
  if [ $oldip != $newip ]
  then
    /usr/bin/curl -i -m 60 -k -u $username:$passwd &#039;https://updates.opendns.com/account/ddns.php?&#039; -silent &gt;&gt; $log_dir/log
  fi
 
  sleep 500
done
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Just a pair of corrections in the script (commented):</p>
<pre>
#!/bin/bash

username=your_opendns_username
passwd=your_opendns_password

while [1]
do
  if [ -z $oldip ] # spaces inside the brackets
  then
  oldip=`/usr/bin/curl <a href="http://nst.sourceforge.net/nst/tools/ip.php" rel="nofollow">http://nst.sourceforge.net/nst/tools/ip.php</a> -silent -i`
  fi

  newip=`/usr/bin/curl <a href="http://nst.sourceforge.net/nst/tools/ip.php" rel="nofollow">http://nst.sourceforge.net/nst/tools/ip.php</a> -silent -i` # no $ sign before newip

  if [ $oldip != $newip ]
  then
    /usr/bin/curl -i -m 60 -k -u $username:$passwd 'https://updates.opendns.com/account/ddns.php?' -silent &gt;&gt; $log_dir/log
  fi

  sleep 500
done
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://bassmadrigal.com/blog/2008/08/opendns-dynamic-ip-update-script-through-linux/comment-page-1/#comment-380</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Fri, 20 Feb 2009 06:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://bassmadrigal.com/blog/?p=7#comment-380</guid>
		<description>The while loop will work, but then it would be pointless to put it in the cron, because it will run automatically every 500 seconds (or different if you change the sleep).

In Nick&#039;s example it will use temporary files, which I personally try to shy away from. But this script does not need root permission, so you should be able to just run it as a normal user.</description>
		<content:encoded><![CDATA[<p>The while loop will work, but then it would be pointless to put it in the cron, because it will run automatically every 500 seconds (or different if you change the sleep).</p>
<p>In Nick&#8217;s example it will use temporary files, which I personally try to shy away from. But this script does not need root permission, so you should be able to just run it as a normal user.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

