更新IP地址的获取方式

ifconfig 和 route 命令,写绝对路径会导致兼容性不好。
1. Debian系统路径对应: /sbin/ifconfig 和 /sbin/route
2. 原命令获取的IP地址兼容性不好,会带“addr:”在前面。 addr:192.163.10.31
3. 本地配置正确的情况下 `hostname -i`是能拿到正确IP的
This commit is contained in:
higkoo 2020-03-23 19:46:59 +08:00 committed by GitHub
parent 408b6494d8
commit b71847feba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ logger:
keepHours: 2
identity:
specify: ""
shell: /usr/sbin/ifconfig `/usr/sbin/route|grep '^default'|awk '{print $NF}'`|grep inet|awk '{print $2}'|head -n 1
shell: hostname -i
sys:
# timeout in ms
# interval in second