From d94d8dd6a465de08aa46cc5faad7382c692052c7 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 5 Jul 2023 10:58:40 -0400 Subject: Suppress cron status log Prevent the progress from getting printed from curl. Note: This seems like some platforms don't like it - we can try redirecting whatever log it writes to to /dev/null --- update.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'update.sh') diff --git a/update.sh b/update.sh index 663cebc..410075b 100755 --- a/update.sh +++ b/update.sh @@ -10,11 +10,11 @@ API_CONFIG=$2 source $API_CONFIG config_ip=$(dig +short $DOMAIN) -actual_ip=$(curl https://ipinfo.io/ip) +actual_ip=$(curl -s https://ipinfo.io/ip) if [ "$config_ip" != "$actual_ip" ]; then echo "Updating IP from $config_id to $actual_ip for $DOMAIN" - res=$(curl -X POST "https://porkbun.com/api/json/v3/dns/retrieve/$DOMAIN" \ + res=$(curl -s -X POST "https://porkbun.com/api/json/v3/dns/retrieve/$DOMAIN" \ -d "{ \"secretapikey\": \"${SECRETAPIKEY}\", \"apikey\": \"${APIKEY}\" }") status=$(echo "$res" | jq -r '.status') if [ "$status" != "SUCCESS" ]; then @@ -22,7 +22,7 @@ if [ "$config_ip" != "$actual_ip" ]; then exit 1 fi ID=$(echo "$res" | jq -r ".records[] | select(.type == \"A\") | select(.content == \"${config_ip}\") | .id") - res=$(curl -X POST "https://porkbun.com/api/json/v3/dns/edit/$DOMAIN/$ID" \ + res=$(curl -s -X POST "https://porkbun.com/api/json/v3/dns/edit/$DOMAIN/$ID" \ -d "{ \"secretapikey\": \"${SECRETAPIKEY}\", \"apikey\": \"${APIKEY}\", \"content\": \"${actual_ip}\", \"ttl\": \"600\", \"type\": \"A\", \"name\": \"\" }") status=$(echo "$res" | jq -r '.status') if [ "$status" == "SUCCESS" ]; then -- cgit v1.2.3-54-g00ecf