From 5c6c8ec4ea80d74cc492cc3b5e8a6c704b7f9572 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sun, 19 Jul 2026 18:49:34 -0600 Subject: [PATCH] [params] Create journal logging switch Create boolean variable to store journal logging preference. Set to 'false' by default. Add parameter to activate this preference. Update help to include this new parameter. --- cfddns.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cfddns.sh b/cfddns.sh index a634291..e09f0b6 100644 --- a/cfddns.sh +++ b/cfddns.sh @@ -157,6 +157,10 @@ scriptHelp() { textBlock "Switch value. Output log to console (stdout) instead of a log file. Can be combined with --nc if desired." textBlockDefaults "(disabled: output to log file)" newline + textBlockSwitches "--log-journal" + textBlock "Switch value. Output a structured log entry to your journaling system instead of a log file. Implies --nc." + textBlockDefaults "(disabled: output to log file)" + newline textBlockSwitches "--no-log" textBlock "Switch value. Do not create a log (i.e. no console, no file). You will not have *any* output from the script if you choose this option, so you will not know if updates succeeded or failed." textBlockDefaults "(disabled: output to log file)" @@ -253,6 +257,7 @@ writeLog() { scriptPath="$(CDPATH='' \cd -- "$(dirname -- "$0")" && pwd -P)" scriptName="$(basename "$0")" logFile="$scriptPath/${scriptName%.*}.log" +logToJournal=0 accountFile="$scriptPath/cloudflare.credentials" colourizeLogFile=1 dnsRecords="" @@ -292,6 +297,10 @@ while [ $# -gt 0 ]; do # log to the console instead of a file logFile="/dev/stdout" ;; + --log-journal) + # log to the journal system instead of a file + logToJournal=1 + ;; --no-log) # do not log anything logFile="/dev/null"