#!/bin/bash for site in www.google.com google.co.in www.xyzzz.com do if curl -I "$site" 2>&1 | grep -w "200\|301" ; then echo"$site is up" else echo"$site is down" fi echo"----------------------------------" done
url_list=( # web https://***.jsp https://***.jsp https://***.jsp https://***.jsp https://***.jsp http://1***.jsp http://1***.jsp # api https://***.jsp https://***.jsp https://***.jsp https://***.jsp https://***.jsp http://1***.jsp http://1***.jsp )
for site in"${url_list[@]}" do if curl -k -i "$site" 2>&1 | grep -w "200\|301" ; then echo"$site is up" else echo"$site is down" fi echo"----------------------------------" done
url_list=( # WEB https://***.jsp https://***.jsp https://***.jsp https://***.jsp http://1***.jsp http://1***.jsp # API https://***.jsp https://***.jsp https://***.jsp https://***.jsp http://1***.jsp http://1***.jsp )
for site in"${url_list[@]}" do if curl -k -i "$site" 2>&1 | grep -w "200\|301" ; then echo -e "$site is ${COLOR_GREEN}up${COLOR_REST}" else echo -e "$site is ${COLOR_RED}down${COLOR_REST}" fi echo"----------------------------------" done