diff --git a/scripts/homepage_status.sh b/scripts/homepage_status.sh new file mode 100644 index 0000000000000000000000000000000000000000..890b3489ec0092e37416615a27cf85f23b801f8a --- /dev/null +++ b/scripts/homepage_status.sh @@ -0,0 +1,35 @@ +#!/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 + + diff --git a/scripts/status_check.sh b/scripts/status_check.sh new file mode 100644 index 0000000000000000000000000000000000000000..8560523e17d73155127f43d7765f6283e1f60290 --- /dev/null +++ b/scripts/status_check.sh @@ -0,0 +1,36 @@ +#!/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