mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-07-06 04:02:43 +00:00
Optimized login function
This commit is contained in:
parent
910649c5f5
commit
0d6864ca4a
@ -21,12 +21,11 @@ log(){
|
|||||||
|
|
||||||
#$1:url
|
#$1:url
|
||||||
url_encode() {
|
url_encode() {
|
||||||
echo "$1" | awk -v ORS="" '{ gsub(/./,"&\n") ; print }' | while read -r l;
|
echo "$1" | awk -v ORS="" '{ gsub(/./,"&\n") ; print }' | while read -r l; do
|
||||||
do
|
|
||||||
case "$l" in
|
case "$l" in
|
||||||
[-_.~a-zA-Z0-9]) printf '%s' "$l" ;;
|
[-_.~a-zA-Z0-9]) printf '%s' "$l" ;;
|
||||||
"") printf '%%20' ;;
|
"") printf '%%20' ;;
|
||||||
* ) printf '%%%02X' "'$l"
|
*) printf '%%%02X' "'$l" ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -69,6 +68,7 @@ login() {
|
|||||||
if [ "${http_code}" = "302" ]; then
|
if [ "${http_code}" = "302" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
rm -rf "${COOKIE_FILE}"
|
||||||
_err "geoscaling login failed for user ${GEOS_Username} bad RC from post"
|
_err "geoscaling login failed for user ${GEOS_Username} bad RC from post"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ get_zone() {
|
|||||||
items=$(echo "${table}" | grep -oE '<a [^>]+><b>[^>]+>')
|
items=$(echo "${table}" | grep -oE '<a [^>]+><b>[^>]+>')
|
||||||
i=1
|
i=1
|
||||||
c=$(count "$1" ".")
|
c=$(count "$1" ".")
|
||||||
while [ $i -le $c ]; do
|
while [ $i -le "$c" ]; do
|
||||||
d=$(echo "$1" | cut -d . -f $i-)
|
d=$(echo "$1" | cut -d . -f $i-)
|
||||||
if [ -z "$d" ]; then
|
if [ -z "$d" ]; then
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user