From a3a19348ca622772017d98b1c2641b993e1a07e4 Mon Sep 17 00:00:00 2001 From: Seth Thomas Date: Thu, 12 May 2016 18:48:41 -0700 Subject: [PATCH] Don't disable udev rules for 15.10+ --- scripts/ubuntu/networking.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/ubuntu/networking.sh b/scripts/ubuntu/networking.sh index e2e39d5ca..395904499 100644 --- a/scripts/ubuntu/networking.sh +++ b/scripts/ubuntu/networking.sh @@ -1,11 +1,17 @@ #!/bin/sh -eux -# Disable automatic udev rules for network interfaces in Ubuntu, -# source: http://6.ptmc.org/164/ -rm -f /etc/udev/rules.d/70-persistent-net.rules; -mkdir -p /etc/udev/rules.d/70-persistent-net.rules; -rm -f /lib/udev/rules.d/75-persistent-net-generator.rules; -rm -rf /dev/.udev/ /var/lib/dhcp3/* /var/lib/dhcp/*; +ubuntu_version="`lsb_release -r | awk '{print $2}'`"; +major_version="`echo $ubuntu_version | awk -F. '{print $1}'`"; + +if [ "$major_version" -le "15" ] && [ "$ubuntu_version" != "15.10" ]; then + echo "Disabling automatic udev rules for network interfaces in Ubuntu" + # Disable automatic udev rules for network interfaces in Ubuntu, + # source: http://6.ptmc.org/164/ + rm -f /etc/udev/rules.d/70-persistent-net.rules; + mkdir -p /etc/udev/rules.d/70-persistent-net.rules; + rm -f /lib/udev/rules.d/75-persistent-net-generator.rules; + rm -rf /dev/.udev/ /var/lib/dhcp3/* /var/lib/dhcp/*; +fi # Adding a 2 sec delay to the interface up, to make the dhclient happy echo "pre-up sleep 2" >>/etc/network/interfaces;