Fix regular expression and test

This commit is contained in:
Dominik Ritter 2019-02-04 15:40:31 +01:00
commit a00cb84da4
2 changed files with 5 additions and 1 deletions

View file

@ -402,7 +402,7 @@ function p9k::parseIp() {
for interfaceName in $relevantInterfaces; do
local interface="$(${ROOT_PREFIX}/sbin/ifconfig $interfaceName 2>/dev/null)"
# Check if interface is UP.
if [[ "${interface/${newline}/}" =~ "<UP(,)?[^>]*>(.*?)inet[ ]*([^ ]*)" ]]; then
if [[ "${interface/${newline}/}" =~ "<UP(,)?[^>]*>(.*)inet[ ]*([^ ]*)" ]]; then
echo "${match[3]}"
return 0
fi