From c807533d14bea43c1d811dbb946f260f97af0b15 Mon Sep 17 00:00:00 2001 From: Alper Kanat Date: Wed, 17 Mar 2021 10:17:29 +0300 Subject: [PATCH] Update dyndns.sh --- dyndns.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dyndns.sh b/dyndns.sh index d95b290..941a69a 100755 --- a/dyndns.sh +++ b/dyndns.sh @@ -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