#!/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