Skip to content
Snippets Groups Projects
Commit ef54831e authored by Brian Weaver's avatar Brian Weaver
Browse files

Homepage status check scripts

parent 49fe6193
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
if [[ -z $1 || -z $2 ]]; then
echo; echo "Usage: $0 <site> <env>";
echo; echo;
exit 1;
fi
if [[ $2 == 'live' ]]; then
DOMAIN=$(terminus domain:list $1.$2 --field=id --filter=type=custom | sort | head -1);
else
terminus env:wake $1.$2 --quiet;
DOMAIN=$(terminus domain:list $1.$2 --field=id --filter=type=platform | sort | head -1);
fi
# echo "Domain: $DOMAIN";
if [[ ! $DOMAIN == '' ]]; then
RESPONSE=`curl -ksSL -w "%{http_code} %{url_effective}" -o /dev/null https://${DOMAIN}`;
#echo -n ".";
HTTP_CODE=`echo "$RESPONSE" | cut -d' ' -f 1`;
URL_EFFECTIVE=`echo "$RESPONSE" | cut -d' ' -f 2`;
if [[ "$HTTP_CODE" == "200" ]]; then
echo "OK: $URL_EFFECTIVE";
elif [[ "$HTTP_CODE" == "404" ]]; then
echo "404 $URL_EFFECTIVE"
else
# echo "######################################";
echo "Error: $HTTP_CODE $URL_EFFECTIVE";
fi
fi
#!/usr/bin/env bash
if [[ -z $1 ]]; then
echo; echo "Usage: $0 <env>";
echo; echo;
exit 1;
fi
SITES=$(terminus org:site:list ohio-state-arts-and-sciences --upstream=b9baf7af-eb2c-4db5-81e6-32d3d9042572 --tag=D8 --fields=name --format=string | sort);
echo $SITES;
parallel --delay 0.1 "./homepage_status.sh {} $1" ::: $SITES
# for f in `terminus org:site:list ohio-state-arts-and-sciences --upstream=b9baf7af-eb2c-4db5-81e6-32d3d9042572 --tag=D8 --fields=name --format=string`; do
# if [[ ! -z "$1" ]]; then
# SITE="$1.$f";
# else
# SITE="$f";
# fi
# #echo -n ".";
# RESPONSE=`curl -ksSL -w "%{http_code} %{url_effective}" -o /dev/null https://${SITE}`;
# #echo -n ".";
# HTTP_CODE=`echo "$RESPONSE" | cut -d' ' -f 1`;
# URL_EFFECTIVE=`echo "$RESPONSE" | cut -d' ' -f 2`;
# if [[ "$HTTP_CODE" == "200" ]]; then
# echo "OK $URL_EFFECTIVE";
# else
# echo "######################################";
# echo "Error: $HTTP_CODE $URL_EFFECTIVE";
# fi
# done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment