mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-11 00:00:06 +00:00
Interface States can be unsorted
This commit is contained in:
parent
9f9bc62dc9
commit
1ab6a32c4b
1 changed files with 7 additions and 3 deletions
|
@ -405,9 +405,13 @@ function p9k::parseIp() {
|
|||
continue
|
||||
fi
|
||||
# Check if interface is UP.
|
||||
if [[ "${interface/${newline}/}" =~ "<UP(,)?[^>]*>(.*)inet[ ]+([^ ]*)" ]]; then
|
||||
echo "${match[3]}"
|
||||
return 0
|
||||
if [[ "${interface/${newline}/}" =~ "<([^>]*)>(.*?)inet[ ]+([^ ]*)" ]]; then
|
||||
local ipFound="${match[3]}"
|
||||
local -a interfaceStates=(${(s:,:)match[1]})
|
||||
if [[ "${interfaceStates[(r)UP]}" == "UP" ]]; then
|
||||
echo "${ipFound}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue