diff options
| author | Brian Murray <brian@ubuntu.com> | 2017-09-11 10:20:18 -0700 |
|---|---|---|
| committer | Jeremy Bicha <jbicha@ubuntu.com> | 2017-11-12 17:04:23 -0500 |
| commit | 22891fd7bb27f495ec8965a338169871d1e8cd57 (patch) | |
| tree | 143c3a978f18d7877f25ce4dae50600b4fbd4b6c /debian/network-manager.postinst | |
| parent | 1ab4db73c1f0db30f3af1845a9c41e3c3952dea1 (diff) | |
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)
Diffstat (limited to 'debian/network-manager.postinst')
| -rw-r--r-- | debian/network-manager.postinst | 9 |
1 files changed, 9 insertions, 0 deletions
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) |