#!/bin/bash # Simple tool to check probation of given URL # using cURL with HTTP GET method. url=$1 TXT_RED='\033[0;31m' TXT_GREEN='\033[0;32m' # check until pressing Ctr+C echo "[$(date +%s)] Start checking probation for url: $url" while true; do if ! curl --max-time 1 --output /dev/null --silent --fail $url &> /dev/null then printf "${TXT_RED}[$(date +%s)] F\n" else printf "${TXT_GREEN}[$(date +%s)] .\n" fi sleep 1 done # check until response success # echo "[$(date +%s)] Start checking probation for url: $url" # until $(curl --max-time 1 --output /dev/null --silent --fail $url); do # printf '.' # sleep 1 # done # echo "" # echo "[$(date +%s)] Finish checking probation for url: $url"