echo '#!/bin/sh HOST="10.19.132.115" # Replace with the host you want to ping while true; do if ping -c 1 "$HOST" >/dev/null; then echo "$(date) - Ping to $HOST is successful." >> /var/log/server-ping.log else echo "$(date) - Ping to $HOST failed." >> /var/log/server-ping.log fi sleep 30 done' > /opt/gd/scripts/server-ping.sh chmod +x /opt/gd/scripts/server-ping.sh /opt/gd/scripts/server-ping.sh > /dev/null 2>&1 &