CMBC 大佬有话说 :
笨牛关闭,分享一个更改cf面板ssl校验方式的脚本
本帖最后由 CMBC 于 2021-7-18 15:22 编辑
理应适合所有linux服务器
必要环境:安装 jq redhat系列,yum install -y jq 其他应该类似。
将下面内容粘贴到服务器文档中,例如保存为cf.sh 则运行 bash cf.sh abc.com
此处的abc.com为cf面板添加的域名将原有的http改为txt 。其他的可以自己在最后修改 支持cname email等
代码如下,里面记得添加自己的email和key
loc代码缩进有问题,直接将附件下载修改后缀为sh或者直接运行都可
#!/usr/bin/bash
domain=$1
[email protected]
cfapikey=259faeef511a847efxxxxxxxxxxxxxxxxxxx
result=`curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=$domain"
-H "X-Auth-Email: $cfemail"
-H "X-Auth-Key: $cfapikey"
-H "Content-Type: application/json"`
zone_identifier=`echo $result | jq .result.id`
zone_identifier=`echo $zone_identifier | sed ‘s/"//g’`
result=`curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$zone_identifier/ssl/certificate_packs?status=all"
-H "X-Auth-Email: $cfemail"
-H "X-Auth-Key: $cfapikey"
-H "Content-Type: application/json"`
result=`echo $result | jq .result`
result_length=`echo $result | jq length`
i=0
while [ $i -lt $result_length ]
do
packge_id=`echo $result | jq .[$i].id`
packge_id=`echo $packge_id | sed ‘s/"//g’`
res=`curl -s -X PATCH "https://api.cloudflare.com/client/v4/zones/$zone_identifier/ssl/verification/$packge_id"
-H "X-Auth-Email: $cfemail"
-H "X-Auth-Key: $cfapikey"
-H "Content-Type: application/json"
–data ‘{"validation_method":"txt"}’ `
echo name:`echo $res|jq .result.verification_info.txt_name`’ type:’`echo $res|jq .result.validation_method`’value:’`echo $res|jq .result.verification_info.txt_value`
i=$(($i+1))
done
我是坏虫 大佬有话说 :
没有关闭啊,还可以登陆正常使用https://cdn.jsdelivr.net/gh/hishis/forum-master/public/images/patch.gif
CMBC 大佬有话说 :
我是坏虫 大佬有话说 : 2021-7-18 15:21
没有关闭啊,还可以登陆正常使用
希望你的cookie永不失效