35 lines
1.1 KiB
Bash
35 lines
1.1 KiB
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
origin=https://dana.195-95-133-47.sslip.io
|
|
headers="/tmp/dana-preview-headers-$$"
|
|
body="/tmp/dana-preview-body-$$"
|
|
cleanup() { rm -f "$headers" "$body"; }
|
|
trap cleanup EXIT INT TERM
|
|
|
|
i=0
|
|
status=000
|
|
while [ "$i" -lt 30 ]; do
|
|
status="$(curl -sS --max-time 10 -D "$headers" -o "$body" -w '%{http_code}' "$origin/" 2>/dev/null || true)"
|
|
[ "$status" = 200 ] && break
|
|
sleep 2
|
|
i=$((i + 1))
|
|
done
|
|
[ "$status" = 200 ]
|
|
grep -qi '^x-robots-tag: noindex, nofollow' "$headers"
|
|
grep -q '<h1' "$body"
|
|
grep -q 'DANA' "$body"
|
|
|
|
for path in /services/ /company/staff/ /price/ /checkup/ /contacts/ /admin/ /api/v1/health; do
|
|
code="$(curl -sS --max-time 15 -o /dev/null -w '%{http_code}' "$origin$path")"
|
|
[ "$code" = 200 ]
|
|
printf '%s=%s\n' "$path" "$code"
|
|
done
|
|
|
|
ability="$(curl -sS --max-time 15 -o /dev/null -w '%{http_code}' https://abilitycenter.ru/)"
|
|
[ "$ability" = 200 ]
|
|
printf 'preview=%s\n' "$status"
|
|
printf 'noindex=ok\n'
|
|
printf 'ability=%s\n' "$ability"
|
|
echo | openssl s_client -connect 127.0.0.1:443 -servername dana.195-95-133-47.sslip.io 2>/dev/null | openssl x509 -noout -subject -issuer -dates
|