<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mcmlxxii &#187; update</title>
	<atom:link href="http://mcmlxxii.co.uk/tag/update/feed/" rel="self" type="application/rss+xml" />
	<link>http://mcmlxxii.co.uk</link>
	<description></description>
	<lastBuildDate>Thu, 22 Jul 2010 17:13:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Siemens SE 587 Dynamic DNS Update script</title>
		<link>http://mcmlxxii.co.uk/2009/09/20/siemens-se-587-dynamic-dns-update-script/</link>
		<comments>http://mcmlxxii.co.uk/2009/09/20/siemens-se-587-dynamic-dns-update-script/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 10:07:02 +0000</pubDate>
		<dc:creator>mcmlxxii</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[afraid]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[freedns]]></category>
		<category><![CDATA[IP address]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[siemens]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://mcmlxxii.co.uk/?p=177</guid>
		<description><![CDATA[Quick script I knocked up to update dynamic dns record at freedns.afraid.org, querying the router for its IP address. Uses expect to login via telnet to the router and curl to GET the http update url. #!/bin/bash # Siemens SE &#8230; <a href="http://mcmlxxii.co.uk/2009/09/20/siemens-se-587-dynamic-dns-update-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Quick script I knocked up to update dynamic dns record at freedns.afraid.org, querying the router for its IP address. Uses expect to login via telnet to the router and curl to GET the http update url.</p>
<p><code>#!/bin/bash<br />
# Siemens SE 587 freedns update script<br />
# Jonathan Cutting mcmlxxii.co.uk<br />
# 20/9/2009</code></p>
<p><code># Config<br />
router_login="your_login_name"<br />
router_password="your_login_password"<br />
router_address="192.168.1.1"<br />
afraid_url="your_dynamic_dns_url"<br />
afraid_update_url="http://freedns.afraid.org/dynamic/update.php?YOUR_UPDATE_CODE"<br />
# End config</code></p>
<p><code>
<pre>dns_record=$(dig +short $afraid_url)
ip_address=$(expect -c "
    set timeout 15
    spawn telnet $router_address
    expect gin:
    send \"$router_login\r\"
    expect word:
    send \"$router_password\r\"
    expect >
    send \"ip show interface ipwan\r\"
    expect >
    exit
" | grep Ipaddr | awk '{print $3}' | sed -e 's/^M//')</pre>
<p></code></p>
<p><code>
<pre>if [ $ip_address != $dns_record ]
then
    date
    curl $afraid_update_url
fi
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://mcmlxxii.co.uk/2009/09/20/siemens-se-587-dynamic-dns-update-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
