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