mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
rule_generator/write_net_rules: prevent interface to be named "eth"
find_next_available() would return "eth" instead of "eth0"
This commit is contained in:
parent
09c0310302
commit
ef5304bc8d
@ -128,6 +128,8 @@ else
|
||||
# if a rule using the current name already exists, find a new name
|
||||
if interface_name_taken; then
|
||||
INTERFACE="$basename$(find_next_available "$basename[0-9]*")"
|
||||
# prevent INTERFACE from being "eth" instead of "eth0"
|
||||
[ "$INTERFACE" = "${INTERFACE%%[ \[\]0-9]*}" ] && INTERFACE=${INTERFACE}0
|
||||
echo "INTERFACE_NEW=$INTERFACE"
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user