From 85f6ae8413116dcb19fe461478f28fd75c172d6d Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 13 Jun 2022 15:34:53 +0200 Subject: [PATCH] Update install-unbound.ps1 --- Scripts/install-unbound.ps1 | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Scripts/install-unbound.ps1 b/Scripts/install-unbound.ps1 index bfa287a4..adfe22b4 100644 --- a/Scripts/install-unbound.ps1 +++ b/Scripts/install-unbound.ps1 @@ -16,40 +16,44 @@ try { $StopWatch = [system.diagnostics.stopwatch]::startNew() - "⏳ Step 1/9: Updating package infos..." + "⏳ Step 1/10: Updating package infos..." & sudo apt update -y if ($lastExitCode -ne "0") { throw "'sudo apt update' failed" } - "⏳ Step 2/9: Installing Unbound package..." + "⏳ Step 2/10: Installing Unbound package..." & sudo apt install unbound -y if ($lastExitCode -ne "0") { throw "'sudo apt install unbound' failed" } - "⏳ Step 3/9: Setting up Unbound..." + "⏳ Step 3/10: Setting up Unbound..." & sudo unbound-control-setup if ($lastExitCode -ne "0") { throw "'unbound-control-setup' failed" } - "⏳ Step 4/9: Updating DNSSEC Root Trust Anchors..." + "⏳ Step 4/10: Updating DNSSEC Root Trust Anchors..." & sudo unbound-anchor if ($lastExitCode -ne "0") { throw "'unbound-anchor' failed" } - "⏳ Step 5/9: Checking config file..." + "⏳ Step 5/10: Checking config file..." & unbound-checkconf "$PSScriptRoot/../Data/unbound.conf" if ($lastExitCode -ne "0") { throw "'unbound-checkconf' failed - check the syntax" } - "⏳ Step 6/9: Copying config file to /etc/unbound/unbound.conf ..." + "⏳ Step 6/10: Copying config file to /etc/unbound/unbound.conf ..." & sudo cp "$PSScriptRoot/../Data/unbound.conf" /etc/unbound/unbound.conf if ($lastExitCode -ne "0") { throw "'cp' failed" } - "⏳ Step 7/9: (Re-)starting Unbound..." + "⏳ Step 7/10: Stopping default DNS cache daemon systemd-resolved..." + & sudo systemctl stop systemd-resolved + & sudo systemctl disable systemd-resolved + + "⏳ Step 8/10: (Re-)starting Unbound..." & sudo unbound-control stop & sudo unbound-control start if ($lastExitCode -ne "0") { throw "'unbound-control start' failed" } - "⏳ Step 8/9: Checking Unbound status..." + "⏳ Step 9/10: Checking Unbound status..." & sudo unbound-control status if ($lastExitCode -ne "0") { throw "'unbound-control status' failed" } - "⏳ Step 9/9: Training Unbound with frequently used domain names..." + "⏳ Step 10/10: Training Unbound with frequently used domain names..." & "$PSScriptRoot/check-dns.ps1" if ($lastExitCode -ne "0") { throw "'unbound-control status' failed" }