mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-25 14:41:40 +00:00
cleanup according to styleguide
This commit is contained in:
parent
534ddf01db
commit
1a5279bd6e
@ -110,19 +110,19 @@ dns_one_rm() {
|
|||||||
# _sub_domain=_acme-challenge.www
|
# _sub_domain=_acme-challenge.www
|
||||||
# _domain=domain.com
|
# _domain=domain.com
|
||||||
_get_root() {
|
_get_root() {
|
||||||
domain=$1
|
domain="$1"
|
||||||
i=2
|
i=2
|
||||||
p=1
|
p=1
|
||||||
while true; do
|
while true; do
|
||||||
h=$(printf "%s" "$domain" | cut -d . -f $i-100)
|
h=$(printf "%s" "$domain" | cut -d . -f $i-100)
|
||||||
|
|
||||||
if [ -z "$h" ]; then
|
if [ -z "$h" ]; then
|
||||||
#not valid
|
#not valid
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
response="$(_get "https://www.one.com/admin/api/domains/$h/dns/custom_records")"
|
response="$(_get "https://www.one.com/admin/api/domains/$h/dns/custom_records")"
|
||||||
|
|
||||||
if ! _contains "$response" "CRMRST_000302"; then
|
if ! _contains "$response" "CRMRST_000302"; then
|
||||||
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
|
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
|
||||||
_domain="$h"
|
_domain="$h"
|
||||||
@ -160,20 +160,20 @@ _dns_one_login() {
|
|||||||
postdata="$postdata&password1=$ONECOM_Password"
|
postdata="$postdata&password1=$ONECOM_Password"
|
||||||
postdata="$postdata&loginTarget="
|
postdata="$postdata&loginTarget="
|
||||||
#_debug postdata "$postdata"
|
#_debug postdata "$postdata"
|
||||||
|
|
||||||
response="$(_post "$postdata" "https://www.one.com/admin/login.do" "" "POST" "application/x-www-form-urlencoded")"
|
response="$(_post "$postdata" "https://www.one.com/admin/login.do" "" "POST" "application/x-www-form-urlencoded")"
|
||||||
#_debug response "$response"
|
#_debug response "$response"
|
||||||
|
|
||||||
# Get SessionID
|
# Get SessionID
|
||||||
JSESSIONID="$(grep "OneSIDCrmAdmin" "$HTTP_HEADER" | grep "^[Ss]et-[Cc]ookie:" | _head_n 1 | _egrep_o 'OneSIDCrmAdmin=[^;]*;' | tr -d ';')"
|
JSESSIONID="$(grep "OneSIDCrmAdmin" "$HTTP_HEADER" | grep "^[Ss]et-[Cc]ookie:" | _head_n 1 | _egrep_o 'OneSIDCrmAdmin=[^;]*;' | tr -d ';')"
|
||||||
_debug jsessionid "$JSESSIONID"
|
_debug jsessionid "$JSESSIONID"
|
||||||
|
|
||||||
if [ -z "$JSESSIONID" ]; then
|
if [ -z "$JSESSIONID" ]; then
|
||||||
_err "error sessionid cookie not found"
|
_err "error sessionid cookie not found"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export _H1="Cookie: ${JSESSIONID}"
|
export _H1="Cookie: ${JSESSIONID}"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user