diff options
author | Patrick Artounian <partounian@users.noreply.github.com> | 2018-10-25 04:26:22 -0700 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2018-10-25 13:26:22 +0200 |
commit | ad9a8f2d434deb698702ba136d935d9d0910a4ae (patch) | |
tree | 34451e5744a7513cf18b67b8ea47bb1581a1e9e3 | |
parent | ad41fe50f9ac8b44b2171fea8b0b990aa9542699 (diff) | |
download | zsh-ad9a8f2d434deb698702ba136d935d9d0910a4ae.tar.gz zsh-ad9a8f2d434deb698702ba136d935d9d0910a4ae.tar.bz2 zsh-ad9a8f2d434deb698702ba136d935d9d0910a4ae.zip |
systemadmin: fix getip output with ifconfig (#7306)
-rw-r--r-- | plugins/systemadmin/systemadmin.plugin.zsh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/systemadmin/systemadmin.plugin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh index 5cc7b7397..bdc2219fa 100644 --- a/plugins/systemadmin/systemadmin.plugin.zsh +++ b/plugins/systemadmin/systemadmin.plugin.zsh @@ -134,12 +134,12 @@ geteip() { curl -s -S https://icanhazip.com } -# determine local IP address +# determine local IP address(es) getip() { if (( ${+commands[ip]} )); then - ip addr | grep "inet " | grep -v '127.0.0.1' | awk '{print $2}' + ip addr | awk '/inet /{print $2}' | command grep -v 127.0.0.1 else - ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' + ifconfig | awk '/inet /{print $2}' | command grep -v 127.0.0.1 fi } |