大哥你好,显示No file, need IP是为什么呀#20
Open
789cn wants to merge 7 commits into
Open
Conversation
我觉得,可能是你没添加这个解析记录 |
Fix abnormal exit in alpine
|
第一次运行,没有当前IP的缓存,就会显示那个错误,第一次运行完之后就没有了。 至于你提到的 "No file, need IP" 提示,这个并不是一个错误,而是脚本的正常行为。 理解 "No file, need IP"脚本中有这样一段代码: WAN_IP_FILE=$HOME/.cf-wan_ip_$CFRECORD_NAME.txt
if [ -f $WAN_IP_FILE ]; then
OLD_WAN_IP=`cat $WAN_IP_FILE`
else
echo "No file, need IP" # 这一行就是你看到的提示
OLD_WAN_IP=""
fi
所以,"No file, need IP" 这个提示,是脚本为了确保在没有历史 IP 记录的情况下也能正常获取并更新 IP 而设计的。它不是一个需要“解决”的问题,而是脚本首次运行或缓存文件被清除时的预期行为。 总结你的 Cloudflare DDNS 脚本现在已经成功运行,并更新了 如果你想验证一下,可以登录你的 Cloudflare 账户,查看 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[root@localhost ~]# ./cf-v4-ddns.sh
No file, need IP
Updating zone_identifier & record_identifier