Ping a Google logo

 #!/bin/bash


# Define the URL for the Google logo

URL="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"


# Function to ping the URL

ping_url() {

  echo "Pinging $URL"

  curl -s -o /dev/null -w "%{http_code}\n" "$URL"

}


# Infinite loop to ping at different intervals

while true; do

  # Ping the URL

  ping_url

  

  # Wait for 5 minutes

  echo "Waiting for 5 minutes..."

  sleep 300

  

  # Ping the URL

  ping_url

  

  # Wait for 10 minutes

  echo "Waiting for 10 minutes..."

  sleep 600

  

  # Ping the URL

  ping_url

  

  # Wait for 15 minutes

  echo "Waiting for 15 minutes..."

  sleep 900

done


Comments

Popular posts from this blog

CURL Commands

$$$$ Symbols in shell scripting