From f1d648e48a7971c300d5e238967c35d6fdc7596a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 29 Mar 2014 09:43:20 +0000 Subject: [PATCH] Handle multiple subdomains --- beaglebone.txt | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/beaglebone.txt b/beaglebone.txt index 8d1efde3..345dded0 100644 --- a/beaglebone.txt +++ b/beaglebone.txt @@ -509,6 +509,48 @@ Via your router's firewall settings you should now open port 22 (secure shell). The freeDNS subdomain which you just created will hereafter just be refered to as "/your domain name/". +If you have multiple freedns subdomains then you may want to rationalise that a little within */etc/crontab*. Rather than listing them all individually create a script: + +#+BEGIN_SRC: bash +emacs /usr/bin/dynamicdns +#+END_SRC + +Add however many freedns subdomains you have. + +#+BEGIN_SRC: bash +#!/bin/bash +# subdomain name 1 +wget -O - http://freedns.afraid.org/dynamic/update.php?== >> /dev/null 2>&1 +# subdomain name 2 +wget -O - http://freedns.afraid.org/dynamic/update.php?== >> /dev/null 2>&1 +... +#+END_SRC + +Save and exit, then make the script runnable and only readable by the root user. + +#+BEGIN_SRC: bash +chmod 400 /usr/bin/dynamicdns +chmod +x /usr/bin/dynamicdns +#+END_SRC + +Then within */etc/crontab* + +#+BEGIN_SRC: bash +emacs /etc/crontab +#+END_SRC + +You can replace the multiple freedns entries with a single line: + +#+BEGIN_SRC: bash +*/10 * * * * root /usr/bin/timeout 60 /usr/bin/dynamicdns +#+END_SRC + +Then save and exit and restart the cron daemon. + +#+BEGIN_SRC: bash +service cron restart +#+END_SRC + ** Set the host name #+BEGIN_SRC: bash