Commit ad9a8f2d authored by Patrick Artounian's avatar Patrick Artounian Committed by Marc Cornellà
Browse files

systemadmin: fix getip output with ifconfig (#7306)

parent ad41fe50
...@@ -134,12 +134,12 @@ geteip() { ...@@ -134,12 +134,12 @@ geteip() {
curl -s -S https://icanhazip.com curl -s -S https://icanhazip.com
} }
# determine local IP address # determine local IP address(es)
getip() { getip() {
if (( ${+commands[ip]} )); then 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 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 fi
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment