Files
Bash_Scrips/scripts/test_con_server_status.sh
2025-06-23 21:19:51 +02:00

16 lines
440 B
Bash

#!/bin/bash
#Roy Cohen
# Test server conection to GW and whire the date and upteme to a logfile
status=$(ps -ef | grep test_con_server_status.sh | grep -v grep |wc -l)
if [ "$status" -ge 3 ] ;
then
exit
else
while true
do
nc -z 10.2.1.1 22 && echo $(date && uptime) >> /var/log/custom/$HOSTNAME
sleep 5
done
fi