File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
files/initrd/opt/arc/include Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -357,11 +357,11 @@ function getBus() {
357357function getIP() {
358358 local IP=" "
359359 if [ -n " ${1} " ] && [ -d " /sys/class/net/${1} " ]; then
360- IP=$( ip route show dev " ${1} " 2> /dev/null | sed -n ' s/ .* via .* src \(.*\) metric .*/\1/p ' | head -1)
361- [ -z " ${IP} " ] && IP=$( ip addr show " ${1} " scope global 2> /dev/null | grep -E " inet .* eth " | awk ' {print $2} ' | cut -d ' / ' -f1 | head -1)
360+ IP=$( ip addr show " ${1} " scope global 2> /dev/null | grep -E " inet .* eth " | awk ' {print $2} ' | cut -d ' / ' -f1 | head -1)
361+ [ -z " ${IP} " ] && IP=$( ip route show dev " ${1} " 2> /dev/null | sed -n ' s/ .* via .* src \(.*\) metric .*/\1/p ' | head -1)
362362 else
363- IP=$( ip route show 2> /dev/null | sed -n ' s/.* via .* src \(.*\) metric .*/\1/p ' | head -1 | awk ' {$1=$1};1 ' )
364- [ -z " ${IP} " ] && IP=$( ip addr show scope global 2> /dev/null | grep -E " inet .* eth " | awk ' {print $2} ' | cut -d ' / ' -f1 | head -1)
363+ IP=$( ip addr show scope global 2> /dev/null | grep -E " inet .* eth " | awk ' {print $2} ' | cut -d ' / ' -f1 | head -1 )
364+ [ -z " ${IP} " ] && IP=$( ip route show 2> /dev/null | sed -n ' s/ .* via .* src \(.*\) metric .*/\1/p ' | head -1)
365365 fi
366366 echo " ${IP} "
367367 return 0
You can’t perform that action at this time.
0 commit comments