Skip to content

Instantly share code, notes, and snippets.

@nlimpid
Created August 28, 2019 03:26
Show Gist options
  • Save nlimpid/74f717951185c1a37192bbbf83fca811 to your computer and use it in GitHub Desktop.
Save nlimpid/74f717951185c1a37192bbbf83fca811 to your computer and use it in GitHub Desktop.
shell curl
generate_post_data()
{
cat <<EOF
{
"type": "A",
"content": "$URLIP"
}
EOF
}
ddns="$(curl -X "PUT" "https://api.cloudflare.com/client/v4/zones/123123/dns_records/3213123" \
-H 'X-Auth-Email: [email protected]' \
-H 'X-Auth-Key: 3213' \
-H 'Content-Type: application/json' \
--data "$(generate_post_data)")"
ddns_result="$(echo ${ddns})"
echo -n "DDNS upadte result:$ddns_result "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment