最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Ros腳本-更新cloudflare域名

2023-08-11 00:01 作者:stan1  | 我要投稿

:local apiKey "yourapikey"

:local zoneID "yourzoneID"

:local domainName "yourdomainame"

:local ttl "600"

#設(shè)置撥號的網(wǎng)絡(luò)名

:local inf "pppoe-out1"


:local recordID ""

#自動獲取cloudflare域名id

:local result [/tool fetch mode=https url="https://api.cloudflare.com/client/v4/zones/$zoneID/dns_records/?name=$domainName" http-method=get http-header="Authorization: Bearer $apiKey" as-value output=user];

:if ($result->"status"= "finished") do={

#:log info $result->"data"->"result"->"id"

:set result [:pick $result 0 ]

:set recordID [:pick $result ([:find $result "\"id\":\""]+6) ([:find $result "\",\"zone_id"])]

:log info $recordID

} else={

:log info "獲取域名id失敗"

}

# Do not edit below

# 原腳本檢查出口ip,然后新舊ip對比,如果不同再更新,按需使用吧

#:local currentIP ([/tool fetch url="https://ifconfig.me/ip" mode=https output=user as-value]->"data")

#:local cloudflareDNSIP [:resolve $domainName server=1.1.1.1];

:local currentIP ""

:set currentIP [/ip address get [/ip address find interface=$inf] address]

:set currentIP [:pick $currentIP 0 ([len $currentIP] -3)]



:if ($currentIP != $cloudflareDNSIP) do={

? # If the IP has changed, update the Cloudflare record

? :log info ("Updating Cloudflare record.? New IP: " . $currentIP);

? :local payload ("{\"type\":\"A\",\"name\":\"" . $domainName . "\",\"content\":\"" . $currentIP . "\",\"ttl\":" . $ttl .",\"proxied\":false}")


? /tool fetch mode=https url="https://api.cloudflare.com/client/v4/zones/$zoneID/dns_records/$recordID" http-method=put http-header="Authorization: Bearer $apiKey"? http-data=$payload output=none;

}


Ros腳本-更新cloudflare域名的評論 (共 條)

分享到微博請遵守國家法律
雅江县| 遵义县| 伊宁市| 广元市| 长岭县| 建德市| 安乡县| 遵义市| 出国| 清远市| 措美县| 永靖县| 体育| 来凤县| 邵阳市| 鹿邑县| 聊城市| 电白县| 郧西县| 云霄县| 鄱阳县| 伊春市| 武邑县| 社旗县| 三门县| 大庆市| 扎兰屯市| 澄迈县| 东至县| 武乡县| 黎川县| 沽源县| 南昌县| 乌审旗| 封丘县| 蛟河市| 上栗县| 沈阳市| 鹰潭市| 故城县| 灵台县|