mirror of
https://github.com/tunix/digitalocean-dyndns
synced 2024-12-22 12:59:52 +00:00
Update dyndns.sh
This commit is contained in:
parent
aa32217f37
commit
c807533d14
1 changed files with 5 additions and 4 deletions
|
@ -38,11 +38,12 @@ while ( true ); do
|
||||||
if [[ -n $ip ]]; then
|
if [[ -n $ip ]]; then
|
||||||
# disable glob expansion
|
# disable glob expansion
|
||||||
set -f
|
set -f
|
||||||
|
|
||||||
for sub in ${NAME//;/ }; do
|
for sub in ${NAME//;/ }; do
|
||||||
record_id=$(echo $domain_records| jq ".domain_records[] | select(.type == \"A\" and .name == \"$sub\") | .id")
|
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")
|
record_data=$(echo $domain_records| jq -r ".domain_records[] | select(.type == \"A\" and .name == \"$sub\") | .data")
|
||||||
|
|
||||||
# re-enalbe glob expansion
|
# re-enable glob expansion
|
||||||
set +f
|
set +f
|
||||||
|
|
||||||
test -z $record_id && echo "No record found with '$sub' domain name!" && continue
|
test -z $record_id && echo "No record found with '$sub' domain name!" && continue
|
||||||
|
|
Loading…
Reference in a new issue