From 9ed3d1adc14c6b2bc6628f212b2298f7c7f91e11 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sat, 25 Jul 2026 01:28:47 -0600 Subject: [PATCH] docs(script): Update embedded script examples Proofreading. Add examples of using new log backends and formats. --- cfddns.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/cfddns.sh b/cfddns.sh index 03edf36..977d987 100644 --- a/cfddns.sh +++ b/cfddns.sh @@ -219,22 +219,31 @@ scriptExamples() { textBlock "${magenta}--- usage examples ---${norm}" newline textBlockSwitches "${scriptName} -r myserver.mydomain.net" - textBlock "Update Cloudflare DNS records for myserver.mydomain.net with the auto-detected public IP4 address. Credentials will be expected in the default location and the log will be written in the default location also." + textBlock "Update Cloudflare DNS records for 'myserver.mydomain.net' with the auto-detected public IP4 address. Credentials will be expected in the default location. The log will be written to the default location in the default JSON format." newline textBlockSwitches "${scriptName} -r myserver.mydomain.net -6" textBlock "Same as above, but update AAAA host records with the auto-detected public IP6 address." newline - textBlockSwitches "${scriptName} -r myserver.mydomain.net,myserver2.mydomain.net -l /var/log/cfddns.log --nc" - textBlock "Update DNS entries for both listed hosts using auto-detected IP4 address. Write a non-coloured log to '/var/log/cfddns.log'." + textBlockSwitches "${scriptName} -r myserver.mydomain.net --fmt-syslog" + textBlock "Same as the first example, but the log file will be written in plain-text format instead of JSON." + newline + textBlockSwitches "${scriptName} -r myserver.mydomain.net --log-console --fmt-syslog" + textBlock "Same as the first example, but the log will be written to the console (stdout) in plain-text instead of a log file." + newline + textBlockSwitches "${scriptName} -r myserver.mydomain.net --log-journal" + textBlock "Same as the first example, but the log will be written to the journal (journald) instead of a log file. A tag of 'CFDDNS' is automatically applied to make filtering easier." + newline + textBlockSwitches "${scriptName} -r myserver.mydomain.net,myserver2.mydomain.net -l /var/log/cfddns.log" + textBlock "Update DNS entries for both listed hosts using the auto-detected IP4 address. Write the log file to the specified location." newline textBlockSwitches "${scriptName} -r myserver.mydomain.net,myserver2.mydomain.net -l /var/log/cfddns.log --ip6 --ip fd21:7a62:2737:9c3a::a151" - textBlock "Update DNS AAAA entries for listed hosts using the *specified* IP address. Write a colourful log to the location specified." + textBlock "Update DNS AAAA entries for listed hosts using the *specified* IP address. Write the log to the location specified." newline - textBlockSwitches "${scriptName} -r myserver.mydomain.net -c /root/cloudflare.creds -l /var/log/cfddns.log --ip 1.2.3.4" - textBlock "Update DNS A entry for listed hostname with the provided IP address. Read cloudflare credentials file from specified location, save log in specified location." + textBlockSwitches "${scriptName} -r myserver.mydomain.net --ip 1.2.3.4 -c /root/cloudflare.creds -l /var/log/cfddns.log --fmt-syslog" + textBlock "Update DNS A entry for 'myserver.mydomain.net' with the *specified* IP address. Read the Cloudflare credentials file from the specified location. Save a plain-text (syslog-style) log in the specified location." newline - textBlockSwitches "${scriptName} -r myserver.mydomain.net -c /root/cloudflare.creds -l /var/log/cfddns.log -6 -i fd21:7a62:2737:9c3a::a151" - textBlock "Exact same as above, but change the AAAA record. This is how you run the script once for IP4 and again for IP6." + textBlockSwitches "${scriptName} -r myserver.mydomain.net -6 -i fd21:7a62:2737:9c3a::a151 -c /root/cloudflare.creds -l /var/log/cfddns.log --fmt-syslog" + textBlock "Exact same as above, but change the AAAA record. This is an example of how you run the script once for IP4 and again for IP6." exit 0 }