Update troubleshoot_server.sh
This commit is contained in:
parent
bc4329ad21
commit
15095d8c23
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue