From 91a51b3fd684e416ec605ff7d47ecd20cfed0a04 Mon Sep 17 00:00:00 2001 From: Rich O Date: Sat, 6 Feb 2021 16:13:41 -0500 Subject: [PATCH] Comments, comments everywhere. --- dns_updater.sh | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/dns_updater.sh b/dns_updater.sh index 81010b1..08d8d45 100644 --- a/dns_updater.sh +++ b/dns_updater.sh @@ -1,11 +1,31 @@ #!/bin/bash +# +#. Description: +#. This script will keep a CloudFlare DNS record up to date with your current public IP address +#. It will use 'dig' to query the IP address for the DNS record, then compare that IP to your current public IP. +#. If the two IP's do not match, the DNS record will be updated with the current IP address via +#. Cloudfare's API. +# +#. Usage: +#. Enter your details for the variables below, then schedule this script to run every 15 or 30 min via cron. +#. The script will output Success/Failure/Skip details that can be easily redirected to a log file. +# +#. Example Crontab Entry: +#. */15 * * * * root /path/to/dns_updater.sh >> /var/log/dns_updater.log 2>&1 +# +#. Author: Rich Oberholtzer (2/2021) CLOUDFLARE_API_KEY="API KEY HERE" AUTH_EMAIL="user@example.com" -#Can be found by logging in to your Cloudflare, click the site/zone, scroll down to the bottom. You'll see if on the right side + +#. Can be found by logging in to your Cloudflare account, click the site/zone, scroll down to the bottom. +#. You'll see it listed on the right side of the page. ZONE_ID="ZONE ID NUMBER HERE" + #This can only be gotten by using the API to get a list of records for the zone. -RECORD_ID="