]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
core80: Update crontab for ddns
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 8 Jul 2014 14:18:00 +0000 (16:18 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 8 Jul 2014 14:18:00 +0000 (16:18 +0200)
config/rootfiles/core/80/update.sh

index 78034bc9343bbf40170b4d145568902a9e06ba0b..5ff84641d1492836023aa1df88e7ed914f1115fb 100644 (file)
@@ -52,6 +52,19 @@ rm -f \
 touch /var/ipfire/ddns/ddns.conf
 chown nobody.nobody /var/ipfire/ddns/ddns.conf
 
+# Update crontab
+sed -i /var/spool/cron/root.orig -e "/setddns.pl/d"
+
+grep -q /usr/bin/ddns /var/spool/cron/root.orig || cat <<EOF >> /var/spool/cron/root.orig
+
+# Update dynamic DNS records every five minutes.
+# Force an update once a month
+*/5 * * * *    [ -f "/var/ipfire/red/active" ] && /usr/bin/ddns update-all
+3 2 1 * *      [ -f "/var/ipfire/red/active" ] && /usr/bin/ddns update-all --force
+EOF
+
+fcrontab -z &>/dev/null
+
 sync
 
 # This update need a reboot...