Update default.inc

This commit is contained in:
2024-02-10 17:11:05 -06:00
parent a70f98550f
commit bd5a7fefab

View File

@@ -239,8 +239,10 @@ service_exists() {
CHECK_HOST(){
if [ ! -z ${1+x} ]; then
if [ "$(dpkg-query -W --showformat='${Status}\n' nmap 2>/dev/null | grep "install ok installed")" != "" ]; then
echo found
[ "$(nmap ${1} -p 22,80,443 -n | grep open)" != "" ] || [ "$(nmap -sU ${1} -p 161 -n | grep open)" != "" ] && echo true || echo false
else
echo not found
ping -c 3 ${1} > /dev/null 2>&1
fi
[ $? -ne 0 ] && echo false || echo true