From 22891fd7bb27f495ec8965a338169871d1e8cd57 Mon Sep 17 00:00:00 2001 From: Brian Murray Date: Mon, 11 Sep 2017 10:20:18 -0700 Subject: handle upgrades from unmanaged policy Drop in an empty override file for NetworkManager to manage all devices for upgrade from any version, as long as there is no netplan configuration yet. (LP: #1676547) --- debian/network-manager.postinst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'debian') diff --git a/debian/network-manager.postinst b/debian/network-manager.postinst index 0f95087f..b0b6ad30 100644 --- a/debian/network-manager.postinst +++ b/debian/network-manager.postinst @@ -44,6 +44,15 @@ case "$1" in ln -sf /run/NetworkManager/resolv.conf /etc/resolv.conf fi fi + + if dpkg --compare-versions "$2" le-nl "9999"; then + mkdir -p /etc/NetworkManager/conf.d || true + # for old versions, override the global config with a null config, + # but only if the netplan config has not been modified by an user. + if find /etc/netplan -name "*.yaml" | wc -l | grep -qc 0; then + touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf + fi + fi ;; abort-upgrade|abort-deconfigure|abort-remove) -- cgit 1.3.0-6-gf8a5