Upgrades: only replace NM /etc/resolv.conf if NM is enabled
This commit is contained in:
parent
ce6da66f61
commit
3905512117
@ -684,7 +684,9 @@ fi
|
||||
# This is for upgrades from previous versions before systemd-resolved became the default.
|
||||
systemctl --no-reload preset systemd-resolved.service &>/dev/null || :
|
||||
|
||||
if systemctl is-enabled systemd-resolved.service &>/dev/null; then
|
||||
if systemctl -q is-enabled systemd-resolved.service &>/dev/null; then
|
||||
systemctl -q is-enabled NetworkManager.service 2>/dev/null && \
|
||||
! test -L /etc/resolv.conf 2>/dev/null && \
|
||||
grep -q 'Generated by NetworkManager' /etc/resolv.conf 2>/dev/null && \
|
||||
echo -e '/etc/resolv.conf was generated by NetworkManager.\nRemoving it to let systemd-resolved manage this file.' && \
|
||||
mv -v /etc/resolv.conf /etc/resolv.conf.orig-with-nm && \
|
||||
|
Loading…
Reference in New Issue
Block a user