From 15095d8c232874266fea86a931ed2747d47404a0 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Mon, 10 Jul 2023 10:13:06 +0100 Subject: [PATCH] Update troubleshoot_server.sh --- troubleshoot_server.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/troubleshoot_server.sh b/troubleshoot_server.sh index 43c25d3e..311c01d7 100644 --- a/troubleshoot_server.sh +++ b/troubleshoot_server.sh @@ -17,7 +17,15 @@ NC='\033[0m' now=$(date) echo -e -------------- $now -------------- | tee -a checklog.log +osname=$(lsb_release -si) +osname=${osname^} +osname=$(echo "$osname" | tr '[A-Z]' '[a-z]') +relno=$(lsb_release -sr | cut -d. -f1) + # Resolve Locally used DNS server +if [[ "$osname" == "debian" && "$relno" == 12 ]]; then +locdns=$(resolvconf -l | grep -m 1 -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+') +else resolvestatus=$(systemctl is-active systemd-resolved.service) if [ $resolvestatus = active ]; then locdns=$(resolvectl | grep -m 1 -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+') @@ -33,6 +41,7 @@ done echo -e $locdns sudo systemctl stop systemd-resolved.service fi +fi while [[ $rmmdomain != *[.]*[.]* ]] do