From 4476a771e2f5fc4db6cd1525f0bd647577931362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florent=20Thi=C3=A9ry?= <florent.thiery@ubicast.eu> Date: Wed, 30 Jan 2019 11:54:27 +0100 Subject: [PATCH] only remove resolv.conf if systemd-resolved is still there --- 1.Base/4.cockpit/0_setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1.Base/4.cockpit/0_setup.py b/1.Base/4.cockpit/0_setup.py index c09f265b..488e3b28 100644 --- a/1.Base/4.cockpit/0_setup.py +++ b/1.Base/4.cockpit/0_setup.py @@ -11,7 +11,7 @@ def setup(interactive=False): 'apt purge --auto-remove -y netplan.io', 'mkdir -p /etc/NetworkManager/conf.d', 'touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf', - 'rm /etc/resolv.conf && cp /run/systemd/resolve/resolv.conf /etc/resolv.conf', + 'ls /run/systemd/resolve/resolv.conf && rm /etc/resolv.conf && cp /run/systemd/resolve/resolv.conf /etc/resolv.conf', 'systemctl disable --now systemd-resolved.service', 'printf "[main]\ndns=default" > /etc/NetworkManager/conf.d/disable-systemd-resolved.conf', ] -- GitLab