Interface States can be unsorted
parent
9f9bc62dc9
commit
1ab6a32c4b
|
@ -405,9 +405,13 @@ function p9k::parseIp() {
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
# Check if interface is UP.
|
# Check if interface is UP.
|
||||||
if [[ "${interface/${newline}/}" =~ "<UP(,)?[^>]*>(.*)inet[ ]+([^ ]*)" ]]; then
|
if [[ "${interface/${newline}/}" =~ "<([^>]*)>(.*?)inet[ ]+([^ ]*)" ]]; then
|
||||||
echo "${match[3]}"
|
local ipFound="${match[3]}"
|
||||||
return 0
|
local -a interfaceStates=(${(s:,:)match[1]})
|
||||||
|
if [[ "${interfaceStates[(r)UP]}" == "UP" ]]; then
|
||||||
|
echo "${ipFound}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue