(原) Cloudflare动态域名

原创文章,请后转载,并注明出处。
#!/bin/bash
auth_token=""
zone_id=""
record_name="scwy.net"
current_ip=$(curl -s4 https://icanhazip.com)
email=""
record_id=""

# 更新DNS记录
curl -X PATCH "https://api.cloudflare.com/client/v4/zones/$zone_id/dns_records/$record_id" \
     -H "Authorization: Bearer $auth_token" \
     -H "Content-Type: application/json" \
     --data "{\"type\":\"A\",\"name\":\"$record_name\",\"content\":\"$current_ip\"}"

相关文章

[ 关闭聊天 ]