1
0
Fork 0
mirror of https://github.com/tunix/digitalocean-dyndns synced 2024-11-17 05:55:25 +00:00

Update dyndns.sh

This commit is contained in:
Alper Kanat 2021-03-17 10:17:29 +03:00 committed by GitHub
parent aa32217f37
commit c807533d14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,14 +36,15 @@ while ( true ); do
echo "Found IP address $ip"
if [[ -n $ip ]]; then
# disable glob expansion
set -f
# disable glob expansion
set -f
for sub in ${NAME//;/ }; do
record_id=$(echo $domain_records| jq ".domain_records[] | select(.type == \"A\" and .name == \"$sub\") | .id")
record_data=$(echo $domain_records| jq -r ".domain_records[] | select(.type == \"A\" and .name == \"$sub\") | .data")
# re-enalbe glob expansion
set +f
# re-enable glob expansion
set +f
test -z $record_id && echo "No record found with '$sub' domain name!" && continue