@@ -44,6 +44,8 @@ function updateNetlify() {
4444 local ZONE_ID=$CACHED_ZONE_ID
4545 fi
4646
47+ bashio::log.info " Got DNS zone ID of $ZONE_ID "
48+
4749 if [ -z $CACHED_RECORD_IP ]; then
4850 local DNS_RECORDS_RESPONSE=$( curl -s -w " %{http_code}" " $NETLIFY_API /dns_zones/$ZONE_ID /dns_records?access_token=$TOKEN " --header " Content-Type:application/json" )
4951 local DNS_RECORDS_RESPONSE_CODE=${DNS_RECORDS_RESPONSE: -3}
@@ -65,6 +67,8 @@ function updateNetlify() {
6567 local RECORD_VALUE=$CACHED_RECORD_IP
6668 fi
6769
70+ bashio::log.info " Got current DNS record value of $RECORD_VALUE "
71+
6872 if [[ " $RECORD_VALUE " != " $EXTERNAL_IP " ]]; then
6973
7074 bashio::log.info " Current external IP is $EXTERNAL_IP , current $HOSTNAME value is $RECORD_VALUE "
@@ -95,12 +99,15 @@ function updateNetlify() {
9599 if [[ $CREATE_RESPONSE_CODE != 201 ]]; then
96100 bashio::log.info " Create response code: ${CREATE_RESPONSE_CODE} "
97101 bashio::log.info " Create response body: ${CREATE_RESPONSE_CONTENT} "
98- bashio::exit.nok " There was a problem creating the new entry for $HOSTNAME on Netlift "
102+ bashio::exit.nok " There was a problem creating the new entry for $HOSTNAME on Netlify "
99103 fi
104+
105+ bashio::log.info " Updated $HOSTNAME to $EXTERNAL_IP "
100106 fi
101107}
102108
103109while true ; do
110+ bashio::log.info " Running IP update"
104111 if bashio::config.has_value " ip" ; then
105112 EXTERNAL_IP=$( bashio::config ' ip' )
106113 if [[ ! $EXTERNAL_IP =~ $IPV4_PATTERN ]]; then
@@ -113,7 +120,5 @@ while true; do
113120
114121 updateNetlify
115122
116- now=" $( date +%s) "
117-
118123 sleep " ${WAIT_TIME} "
119124done
0 commit comments