Test for predictable device names

This commit is contained in:
Bob Mottram 2017-08-07 14:46:08 +01:00
parent 90dc589eb9
commit ee6925eeb6
1 changed files with 5 additions and 2 deletions

View File

@ -49,8 +49,11 @@ function default_network_config {
# device names get assigned random names. This is a hacky workaround. # device names get assigned random names. This is a hacky workaround.
# Also adding net.ifnames=0 to kernel options on bootloader may work. # Also adding net.ifnames=0 to kernel options on bootloader may work.
function enable_predictable_device_names { function enable_predictable_device_names {
test_predictable=$(ls -la /etc/udev/rules.d/80-net-setup-link.rules)
if [[ "$test_predictable" != *"/dev/null" ]]; then
ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
update-initramfs -u update-initramfs -u
fi
} }
function wifi_is_running { function wifi_is_running {