Giter Site home page Giter Site logo

cloudflare-api-v4-ddns's People

Contributors

bill0412 avatar dahlo avatar xiaoxin2016 avatar yulewang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudflare-api-v4-ddns's Issues

Busybox 环境下貌似不支持 grep -Po 这个命令,如何改呢

在脚本中有如下:
grep -Po '(?<="id":")[^"]*' | head -1 )

但是我当前环境是 BusyBox v1.24.1,貌似不支持这个 -- ‘P’的参数, 如何修改呢?

当前执行后报错:
No file, need IP
Updating zone_identifier & record_identifier
grep: invalid option -- 'P'
BusyBox v1.24.1 (2022-03-24 03:19:19 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

-H	Add 'filename:' prefix
-h	Do not add 'filename:' prefix
-n	Add 'line_no:' prefix
-l	Show only names of files that match
-L	Show only names of files that don't match
-c	Show only count of matching lines
-o	Show only the matching part of line
-q	Quiet. Return 0 if PATTERN is found, 1 otherwise
-v	Select non-matching lines
-s	Suppress open and read errors
-r	Recurse
-i	Ignore case
-w	Match whole words only
-x	Match whole lines only
-F	PATTERN is a literal (not regexp)
-E	PATTERN is an extended regexp
-m N	Match up to N times per file
-A N	Print N lines of trailing context
-B N	Print N lines of leading context
-C N	Same as '-A N -B N'
-e PTRN	Pattern to match
-f FILE	Read pattern from file

(23) Failed writing body

运行无效果,但未报错

每次./脚本后
输出“no file.need ip” 和 “Updating zone_identifier & record_identifier”后无反应
cf面板未更新ip,且本地未生成两个存档数据的txt文件
我使用了全局api key 并且在两台机器上分别使用debian和centos做过测试,也用文件内使用方法在/usr目录下实验过
能想到的原因均测试过,实在没办法请教大佬们,希望有大佬解惑

运行报错了

Updating zone_identifier & record_identifier
Updating DNS to 1.1.1.1
cf-v4-ddns.sh: line 140: [: !=: unary operator expected
Something went wrong :(
Response: {
  "result": {
    "id": "e11ce34e68aab16cdc2a93a690cb5935",
    "zone_id": "9fca16d42d77e6f2336df8059a021193",
    "zone_name": "xx.ltd",
    "name": "azure.xx.ltd",
    "type": "A",
    "content": "1.1.1.1",
    "proxiable": true,
    "proxied": false,
    "ttl": 120,
    "locked": false,
    "meta": {
      "auto_added": false,
      "managed_by_apps": false,
      "managed_by_argo_tunnel": false,
      "source": "primary"
    },
    "created_on": "2020-03-14T10:18:03.449524Z",
    "modified_on": "2020-03-14T10:18:03.449524Z"
  },
  "success": true,
  "errors": [],
  "messages": []
}

应该是解析json出错了

第一次使用(未生成文件时),API KEY错误情况下,运行不产生报错

首先感谢大大精简好用的代码,在config填写正确的情况下没有问题,可以正常使用。
出于好奇自己研究了下
在API错误情况下打印:
No file, need IP
Updating zone_identifier & record_identifier
测试了下
大概出现在这个位置

CFZONE_ID=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=$CFZONE_NAME" -H "X-Auth-Email: $CFUSER" -H "X-Auth-Key: $CFKEY" -H "Content-Type: application/json" | grep -Po '(?<="id":")[^"]*' | head -1 )

因为API错误的原因导致文件直接退出没有继续执行后文的错误检测代码

修不来……我爬了

Updating DNS to error code: 1020

我是在crontab里做的定时任务
*/5 * * * * cf-v4-ddns.sh >> /home/latezly/cf-ddns.log 2>&1
image
刚开始启动的时候一直是正常的
过了一段时间就开始报这个错误

Updating DNS to error code: 1020
Something went wrong :(
Response: {"result":null,"success":false,"errors":[{"code":9005,"message":"Content for A record must be a valid IPv4 address."}],"messages":[]}

image
期间偶尔也有一段时间又恢复正常了
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.