summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill <bill@billserver.senders.io>2023-07-05 10:58:40 -0400
committerBill <bill@billserver.senders.io>2023-07-05 10:58:40 -0400
commitd94d8dd6a465de08aa46cc5faad7382c692052c7 (patch)
tree9d98d389e697f368661c96e18909a4ab20f757b6
parent05ddb4ca9571d98e885b8a869ce9adf409ff21a0 (diff)
Suppress cron status logmain
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
-rwxr-xr-xupdate.sh6
1 files changed, 3 insertions, 3 deletions
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