remove resolvconf and enable systemd-resolved

This commit is contained in:
Girish Ramakrishnan
2024-04-29 13:11:27 +02:00
parent 203330d1b8
commit caedf6a8e7

View File

@@ -15,6 +15,8 @@ function log() {
echo -e "$(date +'%Y-%m-%dT%H:%M:%S')" "==> installer: $1"
}
export DEBIAN_FRONTEND=noninteractive
apt_ready="no"
function prepare_apt_once() {
[[ "${apt_ready}" == "yes" ]] && return
@@ -76,10 +78,17 @@ if [[ "${ubuntu_version}" == "18.04" ]]; then
exit 2
fi
# switch over to systemd
systemctl disable unbound || true
systemctl stop unbound || true
systemctl enable --now systemd-resolved
# switch over to resolved and uninstall resolvconf
if dpkg -s resolvconf 2>/dev/null >/dev/null; then
log "disabling unbound"
systemctl disable unbound || true
systemctl stop unbound || true
log "enabling systemd-resolved"
systemctl enable --now systemd-resolved
log "removing resolvconf"
prepare_apt_once
apt -y --purge remove resolvconf # purge required for dpkg -s to return error code
fi
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
readonly docker_version="26.0.1"