remove resolvconf and enable systemd-resolved
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user