From d9d5f71b5ab6dbadece1f8a77624b88205331d24 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 13 Sep 2018 21:25:12 -0600 Subject: [PATCH] Log script start and mode --- cfddns.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cfddns.sh b/cfddns.sh index 97190fe..bee9837 100755 --- a/cfddns.sh +++ b/cfddns.sh @@ -188,6 +188,10 @@ while getopts ':f:r:i:46hxlv' PARAMS; do esac done +# Log beginning of script +echo -e "\e[1;32m [`date %Y-%m-%d` `date %H:%M:%S`] -- Start script execution" \ + "--\e[0m" >> $logFile + # Check validity of parameters if [ -z "$accountFile" ] || [[ $accountFile == -* ]]; then quit 101 @@ -197,6 +201,15 @@ elif [ -z ${dnsRecords} ]; then quit 103 fi +# Log operating mode +if [ $ip4 -eq 1 ]; then + echo -e "\e[1;36m [`date %Y-%m-%d` `date %H:%M:%S`] Script running in IP4" \ + "mode\e[0m" >> $logFile +elif [ $ip6 -eq 1 ]; then + echo -e "\e[1;36m [`date %Y-%m-%d` `date %H:%M:%S`] Script running in IP6" \ + "mode\e[0m" >> $logFile +fi + ## Extract needed information from accountDetails file mapfile -t cfDetails < "$accountFile"