Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个脚本可以联系几个来源并告诉他们“IP 地址 XXX.XXX.XXX.XXX 是我当前的”。我的测试 Web 服务器通过 DHCP 具有动态 IP 地址,除此之外,它需要在其 IP 地址更改时更新 DDNS 条目。然而,它不是唯一的,所以我需要运行我自己的自定义脚本。
我怀疑这可以通过附加要为给定 dhclient 挂钩运行的脚本来实现。但是我仍然需要知道我应该使用哪个钩子,以及如何使用。
我建议将脚本放入 dhclient-exit-hooks.d。因为如果地址更改已经完成,您应该只更改 DDNS 条目。但是,如果分配地址失败,我不确定是否调用了 dhclient-exit-hooks。
编辑:手册页(man dhclient-script)说,exit-hooks 脚本将在 shell 变量(exit_status)中获取退出代码。所以你可以检查一下。
--------------------- Solution ---------------------------
I did a workaround of having to callParent inside my code,
var expandFieldOverride = function(event) {
1 java - HttpClient supporting multiple TLS protocols
1 java - Connect to Apache Accumulo via .NET
3 php - 尝试使用 PHP pthread 时出现“在...中找不到致命错误类 'Thread'”
0 c# - Wait for a process to start, then capture the command line arguments that were provided to it
Reference php × 1429865 c/c++ × 756500 nginx × 49975 mongodb × 159057 mybatis × 3233 anaconda × 13410 pycharm × 14671 python × 1902243 vscode × 56040 docker × 110988 github × 49000 flask × 49129 ffmpeg × 24037 jmeter × 16910 matplotlib × 63493 bootstrap × 54641