vpn 세팅 스크립트 수정 8
This commit is contained in:
+21
-5
@@ -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>\(.*\)<\/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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user