From 1d27d9f45474f7ce25349050efd6a1131accb9f1 Mon Sep 17 00:00:00 2001 From: Qwerty4401 <102785432+Qwerty4401@users.noreply.github.com> Date: Fri, 14 Apr 2023 15:26:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E7=85=A7cloudflare=E7=9A=84API?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按照cloudflare的API格式更新脚本 --- cfddns/cfddns/scripts/cfddns_config.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cfddns/cfddns/scripts/cfddns_config.sh b/cfddns/cfddns/scripts/cfddns_config.sh index d99457c..0512f1b 100755 --- a/cfddns/cfddns/scripts/cfddns_config.sh +++ b/cfddns/cfddns/scripts/cfddns_config.sh @@ -29,15 +29,13 @@ get_bol() { get_record_response() { curl -kLsX GET "https://api.cloudflare.com/client/v4/zones/$cfddns_zid/dns_records?type=$get_type&name=${cfddns_name_domain}&order=type&direction=desc&match=all" \ - -H "X-Auth-Email: $cfddns_email" \ - -H "X-Auth-Key: $cfddns_akey" \ + -H "Authorization: Bearer $cfddns_akey" \ -H "Content-type: application/json" } update_record() { curl -kLsX PUT "https://api.cloudflare.com/client/v4/zones/$cfddns_zid/dns_records/$cfddns_id" \ - -H "X-Auth-Email: $cfddns_email" \ - -H "X-Auth-Key: $cfddns_akey" \ + -H "Authorization: Bearer $cfddns_akey" \ -H "Content-Type: application/json" \ --data '{"type":"'$get_type'","name":"'${cfddns_name_domain}'","content":"'$update_to_ip'","ttl":'$cfddns_ttl',"proxied":'$(get_bol)'}' }