From 4d7591f2451eb8b90c808710ce3134d45e0672e0 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Wed, 12 Sep 2018 00:48:58 -0600 Subject: [PATCH] Extract cloudflare details from file --- cfddns.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cfddns.sh b/cfddns.sh index e7df06c..cbd6d4a 100755 --- a/cfddns.sh +++ b/cfddns.sh @@ -26,6 +26,8 @@ exit 1 unset PARAMS unset accountFile dnsRecords=() +cfDetails=() + ### Process script parameters if [ -z $1 ]; then @@ -61,9 +63,16 @@ elif [ -z ${dnsRecords} ]; then fi +## Extract needed information from accountDetails file +mapfile -t cfDetails < "$accountFile" + + ### Echo results (testing) -echo "Based on parameters provided:" -echo "Login details at: ${accountFile}" -echo "Updating records: ${dnsRecords[*]}" +echo -e "\nBased on parameters provided:" +echo -e "\e[0;35mLogin details at: ${accountFile}" +echo -e "\tAuthorized email: ${cfDetails[0]}" +echo -e "\tAuthorized key: ${cfDetails[1]}" +echo -e "\tZone identifier: ${cfDetails[2]}" +echo -e "\e[0;33mUpdating records: ${dnsRecords[*]}\e[0m\n" exit 0