Corrected [INFO] tagging to have '--' prepended for consistency

This commit is contained in:
Asif Bacchus 2018-09-27 17:02:49 -06:00
parent 7f4de4f0f3
commit 97c7105cb9

View File

@ -253,21 +253,21 @@ if [ -z "$ipAddress" ]; then
quit 201 quit 201
fi fi
fi fi
echo -e "${info}${stamp} [INFO] Using IP address:" \ echo -e "${info}${stamp} -- [INFO] Using IP address:" \
"$ipAddress" >> "$logFile" "$ipAddress" >> "$logFile"
## Check if desired record(s) exist at CloudFlare ## Check if desired record(s) exist at CloudFlare
# perform checks on A or AAAA records based on invocation options # perform checks on A or AAAA records based on invocation options
if [ $ip4 -eq 1 ]; then if [ $ip4 -eq 1 ]; then
echo -e "${normal}${stamp} [INFO] Updating A records: ${dnsRecords[*]}" \ echo -e "${normal}${stamp} -- [INFO] Updating A records: ${dnsRecords[*]}" \
>> "$logFile" >> "$logFile"
for cfLookup in "${dnsRecords[@]}"; do for cfLookup in "${dnsRecords[@]}"; do
cfRecords+=("$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/${cfDetails[2]}/dns_records?name=$cfLookup&type=A" -H "X-Auth-Email: ${cfDetails[0]}" -H "X-Auth-Key: ${cfDetails[1]}" -H "Content-Type: application/json")") cfRecords+=("$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/${cfDetails[2]}/dns_records?name=$cfLookup&type=A" -H "X-Auth-Email: ${cfDetails[0]}" -H "X-Auth-Key: ${cfDetails[1]}" -H "Content-Type: application/json")")
done done
elif [ $ip6 -eq 1 ]; then elif [ $ip6 -eq 1 ]; then
echo -e "${normal}${stamp} [INFO] Updating AAAA records: ${dnsRecords[*]}" \ echo -e "${normal}${stamp} -- [INFO] Updating AAAA records:"\
>> "$logFile" "${dnsRecords[*]}" >> "$logFile"
for cfLookup in "${dnsRecords[@]}"; do for cfLookup in "${dnsRecords[@]}"; do
cfRecords+=("$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/${cfDetails[2]}/dns_records?name=$cfLookup&type=AAAA" -H "X-Auth-Email: ${cfDetails[0]}" -H "X-Auth-Key: ${cfDetails[1]}" -H "Content-Type: application/json")") cfRecords+=("$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/${cfDetails[2]}/dns_records?name=$cfLookup&type=AAAA" -H "X-Auth-Email: ${cfDetails[0]}" -H "X-Auth-Key: ${cfDetails[1]}" -H "Content-Type: application/json")")
done done