Update dyndns.sh

This commit is contained in:
Alper Kanat 2021-03-24 01:03:31 +03:00 committed by GitHub
parent 928616e9e0
commit 0c4833645b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,11 +51,13 @@ while ( true ); do
if [[ -z $record_id ]]; then if [[ -z $record_id ]]; then
echo "No record found with '$sub' domain name. Creating record, sending data=$data to url=$url" echo "No record found with '$sub' domain name. Creating record, sending data=$data to url=$url"
new_record=$(curl -s -X POST \ new_record=$(curl -s -X POST \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d "$data" \ -d "$data" \
"$url") "$url")
record_data=$(echo $new_record| jq -r ".data") record_data=$(echo $new_record| jq -r ".data")
fi fi