Fix indentation
This commit is contained in:
parent
8c6d54ac9e
commit
8560437133
1 changed files with 15 additions and 15 deletions
30
dyndns.sh
30
dyndns.sh
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue