最近想重新整一下自建存一点碎碎念之类的
试了一些 感觉都不太好用
先用 memos 吧
Memos 问题也有点多…
先留个备忘 可能还得换
- ❤️1
当你不想命令行同步,不想 Workerflow 同步,不想 PullBot 同步,可以用这个
ZONE=''
RECORD=''
EMAIL=''
AUTH=''
DOMAIN=''
ipa=$(echo ${ip} | cut -d'.' -f1)
ipb=$(echo ${ip} | cut -d'.' -f2)
ipc=$(echo ${ip} | cut -d'.' -f3)
ipd=$(echo ${ip} | cut -d'.' -f4)
ipab=$(printf '%02x%02x' ${ipa} ${ipb})
ipcd=$(printf '%02x%02x' ${ipc} ${ipd})
porthex=$(printf '%04x' ${port})
IP4P="2001::${porthex}:${ipab}:${ipcd}"
echo $IP4P
while true; do
curl -X PUT "https://api.cloudflare.com/client/v4/zones/${ZONE}/dns_records/${RECORD}" \
-H "X-Auth-Email: ${EMAIL}" \
-H "Authorization: Bearer ${AUTH}" \
-H "Content-Type:application/json" \
--data "{\"type\":\"AAAA\",\"name\":\"${DOMAIN}\",\"content\":\"${IP4P}\",\"ttl\":60,\"proxied\":false}"
if [ $? -eq 0 ]; then
break
fi
done
!(async () => {
const { profile } = await httpAPI('/v1/profiles/current?sensitive=0', 'GET')
$done({ IPv6: /(^|\n)ipv6\s*?=\s*?(true|1)\b/i.test(profile)})
})();
function httpAPI(path = '', method = 'POST', body = null) {
return new Promise(resolve => {
$httpAPI(method, path, body, result => {
resolve(result);
});
});
}