From 13504848d025eb080a0bd83e6e9c1a395d92ee8a Mon Sep 17 00:00:00 2001 From: "kihwan.song" Date: Mon, 13 Jul 2026 17:02:54 +0900 Subject: [PATCH] =?UTF-8?q?vpn=20=EC=84=B8=ED=8C=85=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95=208?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connect-vpn/action.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/connect-vpn/action.yml b/connect-vpn/action.yml index f544a5b..46fb8fe 100644 --- a/connect-vpn/action.yml +++ b/connect-vpn/action.yml @@ -181,6 +181,25 @@ runs: curl -k -sS --http1.1 -A "$UA" "$@" } + summarize_html() { + page="$1" + if [ ! -f "$page" ]; then + return + fi + title="$(sed -n 's/.*\(.*\)<\/title>.*/\1/ip' "$page" | head -1 | tr -d '\r' || true)" + if [ -n "$title" ]; then + echo "응답 title: $title" + fi + if grep -q "ga_code_attempt" "$page"; then + echo "응답 상태: OTP 입력 폼이 다시 표시됨" + fi + sed 's/<[^>]*>/\n/g' "$page" | + sed 's/ / /g; s/&/\&/g; s/^[[:space:]]*//; s/[[:space:]]*$//' | + grep -Eai 'incorrect|invalid|denied|failed|failure|error|otp|password|인증|실패|오류|잘못|거부' | + grep -Ev '^$' | + head -10 || true + } + echo "F5 웹 로그인 시작: ${VPN_HOST} (user=${VPN_USER})" curl_common -L -c "$COOKIE_JAR" "$VPN_HOST/" -o "$WORKDIR/01-login.html" @@ -206,11 +225,6 @@ runs: --data-urlencode "vhost=standard" \ -o "$WORKDIR/03-webtop.html" - if ! grep -q "F5 Dynamic Webtop\|Network Access" "$WORKDIR/03-webtop.html"; then - echo "OTP 인증 후 Webtop에 도달하지 못했습니다." - exit 1 - fi - host_no_scheme="${VPN_HOST#https://}" host_no_scheme="${host_no_scheme#http://}" host_no_scheme="${host_no_scheme%%/*}" @@ -231,6 +245,8 @@ runs: )" if [ -z "$otc" ]; then echo "F5 session token 획득 실패" + summarize_html "$WORKDIR/03-webtop.html" + summarize_html "$WORKDIR/04-token.body" exit 1 fi