summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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