AWS: Rename network interfaces only when necessary

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2018-07-01 11:44:14 +01:00
parent 2e42a9eaa1
commit 470e85c365

View File

@@ -201,7 +201,7 @@ import_aws_configuration() {
# Rename interface
local interface="$(find_interface "${mac}")"
if [ -n "${interface}" ] && [ -n "${interface_name}" ]; then
if [ -n "${interface}" ] && [ -n "${interface_name}" ] && [ "${interface}" != "${interface_name}" ]; then
ip link set "${interface}" down
ip link set "${interface}" name "${interface_name}"
fi