Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

suggested feature in Xbian Config: update IP via a dynamic dns provider
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
suggested feature in Xbian Config: update IP via a dynamic dns provider
15th Nov, 2013, 02:09 AM
Post: #7
zilexa Offline
Registered
Posts: 231
Joined: Feb 2013
Reputation: 9
RE: suggested feature in Xbian Config: update IP via a dynamic dns provider
OK this is the solution. I still want to add a few other IP check services in case ipecho.net goes down. But for now it works perfectly. For reference if anyone else wants this:

Schedule this script to run every x hours, mine runs every 4 hours (type crontab -e in terminal and add this to the bottom):
Code:
0 */4 * * * sudo sh /etc/ipupdate/ipupdate.sh

the script, create a new textfile (sudo nano /etc/ipupdate/ipupdate.sh) and copy paste:
Code:
# this script will check if the current external IP address has been
# changed by your ISP internet provider. If so, it will update your
# subdomain (for example: mypc.freedns.org). This way, you will always
# be able to connect to your Raspberry when you are not at home and don't know
# the IP address of your home. Also handy if your ISP internet provider keeps changing your IP.

TOKEN="add your token from your freedns subdomain"

if test -f /etc/ipupdate/ipupdate.conf
then
CacheIP=$(cat /etc/ipupdate/ipupdate.conf)
fi

ExternIP=$(wget -qO- http://ipecho.net/plain)

if [ "$ExternIP" = "$CacheIP" ]
then
# Both IP are equal
echo "Update not required..."
else
# The IP has change
echo "Updating http://free.afraid.org with " $ExternIP
wget http://freedns.afraid.org/dynamic/update.php?$TOKEN -o /dev/null -O /dev/stdout
echo `date` "Updating log with IP " $ExternIP >> /var/log/dmesg
fi
sudo rm -f /etc/ipupdate/ipupdate.conf
sudo echo $ExternIP > /etc/ipupdate/ipupdate.conf
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Messages In This Thread
suggested feature in Xbian Config: update IP via a dynamic dns provider - zilexa - 9th Nov, 2013, 07:51 AM
RE: suggested feature in Xbian Config: update IP via a dynamic dns provider - f1vefour - 11th Nov, 2013, 12:15 PM
RE: suggested feature in Xbian Config: update IP via a dynamic dns provider - zilexa - 11th Nov, 2013, 08:27 PM
RE: suggested feature in Xbian Config: update IP via a dynamic dns provider - mk01 - 13th Nov, 2013, 11:02 AM
RE: suggested feature in Xbian Config: update IP via a dynamic dns provider - zilexa - 14th Nov, 2013, 12:18 AM
RE: suggested feature in Xbian Config: update IP via a dynamic dns provider - f1vefour - 14th Nov, 2013, 04:31 AM
RE: suggested feature in Xbian Config: update IP via a dynamic dns provider - zilexa - 15th Nov, 2013 02:09 AM

Possibly Related Threads...
Thread: Author Replies Views: Last Post
  [SOLVED] [xbian-config] Kernel update reverted crs 5 17,239 13th Dec, 2012 05:47 AM
Last Post: BartOtten

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 5th Jun, 2025, 06:56 PM Powered By MyBB, © 2002-2025 MyBB Group.