Website status - saviovettoor/DevOps-wiki GitHub Wiki

#!/bin/bash
url=$1
status_code=`curl -Is $url | head -n 1 | awk {'print $2'}`
if [ $status_code == 200 ]; then
  echo "Website is reachable"
elif [ $status_code == 301 ]; then
  echo "Website Moved Permanently"
else
  echo "Website is not reachable"
fi