serverping.sh: check only the server host and fix the up/down test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 14:59:00 -04:00
co-authored by Claude Opus 5.5
parent 400c6b1ec1
commit 623dc9cf5d
+1 -10
View File
@@ -5,17 +5,8 @@
SERVER_IP="192.168.1.19"
echo -e "Testing Connection...\n\n"
nmap -sP 192.168.1.1/24 > /tmp/addresses.txt
#grep -Fxq ""
#${pingcmd} ${SERVER_IP} &>/dev/null
grepcmd=$(grep -F "${SERVER_IP}" /tmp/addresses.txt)
echo $grepcmd
if [ ! ${grepcmd} ];then
if ! nmap -sn "${SERVER_IP}" | grep -q "Host is up";then
echo -e "\nThe server is down\n"
notify-send "Server offline"
else