Commit 747dd89a authored by Harm Berntsen's avatar Harm Berntsen Committed by Natanael Copa
Browse files

Add missing return to ip_choose_if

Right now, when $KOPT_BOOTIF is specified, it can echo a device related
to that option and still continue with the loop that checks the
operstate. Due to this, it can echo two network interfaces. This commit
fixes that so it will only return a single network interface.
parent 29cb8111
......@@ -128,7 +128,7 @@ ip_choose_if() {
mac=$(printf "%s\n" "$KOPT_BOOTIF"|sed 's/^01-//;s/-/:/g')
dev=$(grep -l $mac /sys/class/net/*/address|head -n 1)
[ -n "$dev" ] && echo "${dev##*/}"
[ -n "$dev" ] && echo "${dev##*/}" && return
for x in /sys/class/net/eth*; do
if grep -iq up $x/operstate;then
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment