Files
Docker-Chevereto/scripts/system/cloudflare--create.sh

13 lines
394 B
Bash
Raw Normal View History

2023-01-11 20:21:52 -03:00
#!/bin/bash
curl --request POST \
--url https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE_ID}/dns_records \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${CLOUDFLARE_TOKEN}" \
--data '{
2023-01-13 08:58:34 -03:00
"content": "'"${CLOUDFLARE_A_NAME}"'",
"name": "'"${HOSTNAME}"'",
"type": "CNAME",
"proxied": true,
"ttl": 3600
}' | jq -r '.result.id'