Update troubleshoot_server.sh

This commit is contained in:
dinger1986 2023-07-10 10:13:06 +01:00 committed by GitHub
parent bc4329ad21
commit 15095d8c23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -17,7 +17,15 @@ NC='\033[0m'
now=$(date) now=$(date)
echo -e -------------- $now -------------- | tee -a checklog.log 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 # 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) resolvestatus=$(systemctl is-active systemd-resolved.service)
if [ $resolvestatus = active ]; then if [ $resolvestatus = active ]; then
locdns=$(resolvectl | grep -m 1 -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+') locdns=$(resolvectl | grep -m 1 -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
@ -33,6 +41,7 @@ done
echo -e $locdns echo -e $locdns
sudo systemctl stop systemd-resolved.service sudo systemctl stop systemd-resolved.service
fi fi
fi
while [[ $rmmdomain != *[.]*[.]* ]] while [[ $rmmdomain != *[.]*[.]* ]]
do do