diff --git a/lib/functions/rootfs/distro-agnostic.sh b/lib/functions/rootfs/distro-agnostic.sh index 5a8c797291..83519d7038 100644 --- a/lib/functions/rootfs/distro-agnostic.sh +++ b/lib/functions/rootfs/distro-agnostic.sh @@ -546,7 +546,7 @@ function install_distribution_agnostic() { # enable PubkeyAuthentication sed -i 's/#\?PubkeyAuthentication .*/PubkeyAuthentication yes/' "${SDCARD}"/etc/ssh/sshd_config - if [ -f "${SDCARD}"/etc/NetworkManager/NetworkManager.conf ]; then + if [[ -f "${SDCARD}"/etc/NetworkManager/NetworkManager.conf ]]; then # configure network manager sed "s/managed=\(.*\)/managed=true/g" -i "${SDCARD}"/etc/NetworkManager/NetworkManager.conf diff --git a/lib/functions/rootfs/post-tweaks.sh b/lib/functions/rootfs/post-tweaks.sh index ed0e0ca94f..741b4300e8 100644 --- a/lib/functions/rootfs/post-tweaks.sh +++ b/lib/functions/rootfs/post-tweaks.sh @@ -3,12 +3,13 @@ function post_debootstrap_tweaks() { display_alert "Applying post-tweaks" "post_debootstrap_tweaks" "debug" - # activate systemd-resolved - if [[ -d "${SDCARD}"/etc/systemd/network ]]; then - display_alert "Activating systemd-resolved" "Symlink resolv.conf" "debug" - # configure networkd - run_host_command_logged rm -fv "${SDCARD}"/etc/resolv.conf - run_host_command_logged ln -s /run/systemd/resolve/resolv.conf "${SDCARD}"/etc/resolv.conf + # activate systemd-resolved, if not using NetworkManager + if [[ ! -f "${SDCARD}"/etc/NetworkManager/NetworkManager.conf ]]; then + if [[ -d "${SDCARD}"/etc/systemd/network ]]; then + display_alert "Activating systemd-resolved" "Symlink resolv.conf to systemd-resolved's" "debug" + run_host_command_logged rm -fv "${SDCARD}"/etc/resolv.conf + run_host_command_logged ln -s /run/systemd/resolve/resolv.conf "${SDCARD}"/etc/resolv.conf + fi fi # remove service start blockers