1
0
Fork 0
mirror of https://github.com/tunix/digitalocean-dyndns synced 2024-04-29 23:23:38 +00:00

Fix indentation

This commit is contained in:
lawtancool 2021-07-04 17:30:45 -07:00
parent 8c6d54ac9e
commit 8560437133

View file

@ -46,22 +46,22 @@ while ( true ); do
record_data=$(echo $domain_records| jq -r ".domain_records[] | select(.type == \"A\" and .name == \"$sub\") | .data") record_data=$(echo $domain_records| jq -r ".domain_records[] | select(.type == \"A\" and .name == \"$sub\") | .data")
if [ $(echo "$record_id" | wc -l) -ge 2 ]; then : if [ $(echo "$record_id" | wc -l) -ge 2 ]; then :
if [[ "${remove_duplicates}" == "true" ]]; then : if [[ "${remove_duplicates}" == "true" ]]; then :
echo "'$sub' domain name has duplicate DNS records, removing duplicates" echo "'$sub' domain name has duplicate DNS records, removing duplicates"
record_id_to_delete=$(echo "$record_id"| tail -n +2) record_id_to_delete=$(echo "$record_id"| tail -n +2)
record_id=$(echo "$record_id"| head -1) record_id=$(echo "$record_id"| head -1)
record_data=$(echo "$record_data"| head -1) record_data=$(echo "$record_data"| head -1)
while IFS= read -r line; do while IFS= read -r line; do
curl -s -X DELETE \ curl -s -X DELETE \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"$dns_list/$line" &> /dev/null "$dns_list/$line" &> /dev/null
done <<< "$record_id_to_delete" done <<< "$record_id_to_delete"
else : else :
echo "Unable to update '$sub' domain name as it has duplicate DNS records. Set REMOVE_DUPLICATES='true' to remove them." echo "Unable to update '$sub' domain name as it has duplicate DNS records. Set REMOVE_DUPLICATES='true' to remove them."
continue continue
fi fi
fi fi
# re-enable glob expansion # re-enable glob expansion