Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更新IP地址的获取方式 #18

Merged
merged 1 commit into from
Mar 24, 2020
Merged

更新IP地址的获取方式 #18

merged 1 commit into from
Mar 24, 2020

Conversation

higkoo
Copy link
Contributor

@higkoo higkoo commented Mar 23, 2020

在不同操作系统下全路径不一样,比如上述的 ifconfig / route 在 Debian 系统的 /sbin 目录下。
另外 Debian 打印出来 多 'addr:' 需要多处理 /sbin/ifconfig /sbin/route|grep '^default'|awk '{print $NF}'|grep inet|awk '{print $2}'|awk -F':' '{print $2}'|head -n 1
还不如直接 hostname -i 获取,正常配置下都Okay的。

在不同操作系统下全路径不一样,比如上述的 ifconfig / route 在 Debian 系统的 /sbin 目录下。
另外 Debian 打印出来 多 'addr:' 需要多处理 /sbin/ifconfig `/sbin/route|grep '^default'|awk '{print $NF}'`|grep inet|awk '{print $2}'|awk -F':' '{print $2}'|head -n 1
还不如直接 hostname -i 获取,正常配置下都Okay的。
@UlricQin UlricQin merged commit 9ba3854 into ccfos:master Mar 24, 2020
@higkoo higkoo deleted the patch-2 branch March 29, 2020 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants