diff --git a/bashrc b/bashrc index d137061..3bd6694 100755 --- a/bashrc +++ b/bashrc @@ -548,8 +548,8 @@ __my_battery_status(){ alias bat='__my_battery_status %s\\n' ip-address(){ - test type ifconfig >/dev/null 2>&1 || return 1 - local ip=$(LANG=C ifconfig | \grep --color=never "inet " | \grep --color=never -v "127.0.0.1" | awk '{print $2}') + type ip >/dev/null 2>&1 || return 1 + local ip=$(LANG=C ip addr show scope global | \grep --color=never --only-matching 'inet [^ ]*' | cut -d " " -f 2) test -n "$ip" && printf $1 $ip }