The N900 got python installed already so I googled around a bit for a python script that could update dyndns service. I found one at: http://ipcheck.sourceforge.net/.
The download is a single file ipcheck.py so I created a directory /opt/ipcheck and copied the ipcheck.py into this directory.
Now I ran a check to see if it worked - something along the line of:
cd /opt/ipcheck
./ipcheck.py --makedat -l -r checkip.dyndns.org:8245 username password domain
Where:
username: my username on dyndns.org
password: my password at dyndns.org
domain: the hostname + domain I registered at dyndns.org
Now all that's left is to get this command run automatically each time the device connects. To do this I created a small shell script /etc/network/if-up.d/ipcheck like this:
#!/bin/sh
#
if [ ! -d /opt/ipcheck ]; then
exit 1
fi
cd /opt/ipcheck
./ipcheck.py -l -r checkip.dyndns.org:8245 username password hostname.getmyip.com
exit 0
That is about it. Now I don't have to check the external IP address of my device.
No comments:
Post a Comment