mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-08-21 15:43:29 +08:00
32
.github/workflows/vtag.yml
vendored
Normal file
32
.github/workflows/vtag.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: Mirror version tag
|
||||||
|
|
||||||
|
# Historical release tags are plain version numbers ("3.1.3") and cannot be
|
||||||
|
# renamed. When a plain version tag is pushed (including the tag created by
|
||||||
|
# publishing a GitHub release), mirror it as a "v"-prefixed tag ("v3.1.3")
|
||||||
|
# pointing to the same object, so both forms exist.
|
||||||
|
# No retrigger loop: the tag filter never matches a "v"-prefixed tag, and
|
||||||
|
# refs created with GITHUB_TOKEN do not fire workflows anyway.
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '[0-9]*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
vtag:
|
||||||
|
if: github.repository == 'acmesh-official/acme.sh'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Create the v-prefixed tag
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
if gh api "repos/${{ github.repository }}/git/ref/tags/v${{ github.ref_name }}" >/dev/null 2>&1; then
|
||||||
|
echo "Tag v${{ github.ref_name }} already exists, nothing to do."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
gh api "repos/${{ github.repository }}/git/refs" -f ref="refs/tags/v${{ github.ref_name }}" -f sha="${{ github.sha }}"
|
||||||
|
echo "Created tag v${{ github.ref_name }} -> ${{ github.sha }}"
|
||||||
7
acme.sh
7
acme.sh
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
VER=3.1.4
|
VER=3.1.5
|
||||||
|
|
||||||
PROJECT_NAME="acme.sh"
|
PROJECT_NAME="acme.sh"
|
||||||
|
|
||||||
@@ -6078,7 +6078,10 @@ $_authorizations_map"
|
|||||||
#some devices and APIs reject them, so the certs are stored back to back.
|
#some devices and APIs reject them, so the certs are stored back to back.
|
||||||
#https://github.com/acmesh-official/acme.sh/issues/1940
|
#https://github.com/acmesh-official/acme.sh/issues/1940
|
||||||
_strip_blank_lines() {
|
_strip_blank_lines() {
|
||||||
sed '/^[[:space:]]*$/d'
|
#spell out space and tab: Solaris sed treats [[:space:]] as a literal
|
||||||
|
#bracket set and silently stops matching the blank lines
|
||||||
|
_sbl_tab="$(printf '\t')"
|
||||||
|
sed "/^[ $_sbl_tab]*\$/d"
|
||||||
}
|
}
|
||||||
|
|
||||||
_split_cert_chain() {
|
_split_cert_chain() {
|
||||||
|
|||||||
@@ -163,8 +163,8 @@ byteplus_alb_deploy() {
|
|||||||
# ── 3. Read cert and key ─────────────────────────────────────────────────────
|
# ── 3. Read cert and key ─────────────────────────────────────────────────────
|
||||||
# BytePlus requires NO blank lines between PEM blocks in the certificate chain
|
# BytePlus requires NO blank lines between PEM blocks in the certificate chain
|
||||||
|
|
||||||
_public_key=$(sed '/^[[:space:]]*$/d' "$_cfullchain" | tr -d '\r')
|
_public_key=$(_strip_blank_lines <"$_cfullchain" | tr -d '\r')
|
||||||
_private_key=$(sed '/^[[:space:]]*$/d' "$_ckey" | tr -d '\r')
|
_private_key=$(_strip_blank_lines <"$_ckey" | tr -d '\r')
|
||||||
|
|
||||||
if [ -z "$_public_key" ] || [ -z "$_private_key" ]; then
|
if [ -z "$_public_key" ] || [ -z "$_private_key" ]; then
|
||||||
_err "Failed to read certificate or key file."
|
_err "Failed to read certificate or key file."
|
||||||
|
|||||||
@@ -323,21 +323,21 @@ _bhosted_extract_id() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# JSON: "id":12345
|
# JSON: "id":12345
|
||||||
_id="$(printf "%s" "$_resp" | _egrep_o '"id"[[:space:]]*:[[:space:]]*[0-9]+' | _head_n 1 | tr -cd '0-9')"
|
_id="$(printf "%s" "$_resp" | _egrep_o '"id"[ ]*:[ ]*[0-9]+' | _head_n 1 | tr -cd '0-9')"
|
||||||
if [ -n "$_id" ]; then
|
if [ -n "$_id" ]; then
|
||||||
printf "%s" "$_id"
|
printf "%s" "$_id"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# key=value: id=12345
|
# key=value: id=12345
|
||||||
_id="$(printf "%s" "$_resp" | _egrep_o '(^|[[:space:][:punct:]])id[[:space:]]*=[[:space:]]*[0-9]+' | _head_n 1 | tr -cd '0-9')"
|
_id="$(printf "%s" "$_resp" | _egrep_o '(^|[^0-9a-zA-Z])id[ ]*=[ ]*[0-9]+' | _head_n 1 | tr -cd '0-9')"
|
||||||
if [ -n "$_id" ]; then
|
if [ -n "$_id" ]; then
|
||||||
printf "%s" "$_id"
|
printf "%s" "$_id"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# "record id 12345" / "recordid 12345"
|
# "record id 12345" / "recordid 12345"
|
||||||
_id="$(printf "%s" "$_resp" | _egrep_o '(record[[:space:]]*id|recordid)[^0-9]*[0-9]+' | _head_n 1 | tr -cd '0-9')"
|
_id="$(printf "%s" "$_resp" | _egrep_o '(record[ ]*id|recordid)[^0-9]*[0-9]+' | _head_n 1 | tr -cd '0-9')"
|
||||||
if [ -n "$_id" ]; then
|
if [ -n "$_id" ]; then
|
||||||
printf "%s" "$_id"
|
printf "%s" "$_id"
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ dns_creoline_rm() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
record_id=$(echo "$response" | _egrep_o "\"id\"[[:space:]]*:[[:space:]]*[0-9]+" | cut -d : -f 2 | tr -d \" | _head_n 1 | tr -d " ")
|
record_id=$(echo "$response" | _egrep_o "\"id\"[ ]*:[ ]*[0-9]+" | cut -d : -f 2 | tr -d \" | _head_n 1 | tr -d " ")
|
||||||
_debug "record_id" "$record_id"
|
_debug "record_id" "$record_id"
|
||||||
|
|
||||||
if [ -z "$record_id" ]; then
|
if [ -z "$record_id" ]; then
|
||||||
@@ -108,10 +108,10 @@ _get_root() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_sub_domain=$(echo "$response" | _egrep_o "\"subDomain\"[[:space:]]*:[[:space:]]*\"[^\"]+\"" | cut -d : -f 2 | tr -d \" | _head_n 1 | tr -d " ")
|
_sub_domain=$(echo "$response" | _egrep_o "\"subDomain\"[ ]*:[ ]*\"[^\"]+\"" | cut -d : -f 2 | tr -d \" | _head_n 1 | tr -d " ")
|
||||||
_debug _sub_domain "$_sub_domain"
|
_debug _sub_domain "$_sub_domain"
|
||||||
|
|
||||||
_domain=$(echo "$response" | _egrep_o "\"domain\"[[:space:]]*:[[:space:]]*\"[^\"]+\"" | cut -d : -f 2 | tr -d \" | _head_n 1 | tr -d " ")
|
_domain=$(echo "$response" | _egrep_o "\"domain\"[ ]*:[ ]*\"[^\"]+\"" | cut -d : -f 2 | tr -d \" | _head_n 1 | tr -d " ")
|
||||||
_debug _domain "$_domain"
|
_debug _domain "$_domain"
|
||||||
|
|
||||||
if [ -z "$_domain" ] || [ -z "$_sub_domain" ]; then
|
if [ -z "$_domain" ] || [ -z "$_sub_domain" ]; then
|
||||||
@@ -171,7 +171,7 @@ _creoline_rest() {
|
|||||||
_err "URI:$uri"
|
_err "URI:$uri"
|
||||||
return 1
|
return 1
|
||||||
elif _contains "$response" "message"; then
|
elif _contains "$response" "message"; then
|
||||||
message=$(echo "$response" | _egrep_o "\"message\"[[:space:]]*:[[:space:]]*\"[^\"]+\"" | cut -d : -f 2 | tr -d \")
|
message=$(echo "$response" | _egrep_o "\"message\"[ ]*:[ ]*\"[^\"]+\"" | cut -d : -f 2 | tr -d \")
|
||||||
_err "Error: $message"
|
_err "Error: $message"
|
||||||
_err "URI:$uri"
|
_err "URI:$uri"
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -30,8 +30,9 @@ dns_czechia_add() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/[[:space:]]//g; s/\.$//')
|
_czechia_tab="$(printf '\t')"
|
||||||
_tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//')
|
_cz=$(printf "%s" "$_current_zone" | _lower_case | sed "s/[ $_czechia_tab]//g; s/\.\$//")
|
||||||
|
_tk=$(printf "%s" "$CZ_AuthorizationToken" | sed "s/^[ $_czechia_tab]*//; s/[ $_czechia_tab]*\$//")
|
||||||
|
|
||||||
if [ -z "$_cz" ] || [ -z "$_tk" ]; then
|
if [ -z "$_cz" ] || [ -z "$_tk" ]; then
|
||||||
_err "Missing zone or CZ_AuthorizationToken."
|
_err "Missing zone or CZ_AuthorizationToken."
|
||||||
@@ -108,8 +109,9 @@ dns_czechia_rm() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_cz=$(printf "%s" "$_current_zone" | _lower_case | sed 's/[[:space:]]//g; s/\.$//')
|
_czechia_tab="$(printf '\t')"
|
||||||
_tk=$(printf "%s" "$CZ_AuthorizationToken" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//')
|
_cz=$(printf "%s" "$_current_zone" | _lower_case | sed "s/[ $_czechia_tab]//g; s/\.\$//")
|
||||||
|
_tk=$(printf "%s" "$CZ_AuthorizationToken" | sed "s/^[ $_czechia_tab]*//; s/[ $_czechia_tab]*\$//")
|
||||||
|
|
||||||
if [ -z "$_cz" ] || [ -z "$_tk" ]; then
|
if [ -z "$_cz" ] || [ -z "$_tk" ]; then
|
||||||
_err "Missing zone or CZ_AuthorizationToken."
|
_err "Missing zone or CZ_AuthorizationToken."
|
||||||
@@ -180,12 +182,13 @@ _czechia_load_conf() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_czechia_pick_zone() {
|
_czechia_pick_zone() {
|
||||||
|
_czechia_pz_tab="$(printf '\t')"
|
||||||
_fd=$(printf "%s" "$1" | _lower_case | sed 's/\.$//')
|
_fd=$(printf "%s" "$1" | _lower_case | sed 's/\.$//')
|
||||||
_best_zone=""
|
_best_zone=""
|
||||||
|
|
||||||
_zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g')
|
_zones_space=$(printf "%s" "$CZ_Zones" | sed 's/,/ /g')
|
||||||
for _z in $_zones_space; do
|
for _z in $_zones_space; do
|
||||||
_clean_z=$(printf "%s" "$_z" | _lower_case | sed 's/[[:space:]]//g; s/\.$//')
|
_clean_z=$(printf "%s" "$_z" | _lower_case | sed "s/[ $_czechia_pz_tab]//g; s/\.\$//")
|
||||||
[ -z "$_clean_z" ] && continue
|
[ -z "$_clean_z" ] && continue
|
||||||
|
|
||||||
case "$_fd" in
|
case "$_fd" in
|
||||||
|
|||||||
@@ -441,18 +441,18 @@ _hostup_json_extract() {
|
|||||||
input="${2:-$line}"
|
input="${2:-$line}"
|
||||||
|
|
||||||
# First try to extract quoted values (strings)
|
# First try to extract quoted values (strings)
|
||||||
quoted_match="$(printf "%s" "$input" | _egrep_o "\"$key\"[[:space:]]*:[[:space:]]*\"[^\"]*\"" | _head_n 1)"
|
quoted_match="$(printf "%s" "$input" | _egrep_o "\"$key\"[ ]*:[ ]*\"[^\"]*\"" | _head_n 1)"
|
||||||
if [ -n "$quoted_match" ]; then
|
if [ -n "$quoted_match" ]; then
|
||||||
printf "%s" "$quoted_match" |
|
printf "%s" "$quoted_match" |
|
||||||
cut -d : -f2- |
|
cut -d : -f2- |
|
||||||
sed 's/^[[:space:]]*"//' |
|
sed 's/^[ ]*"//' |
|
||||||
sed 's/"[[:space:]]*$//' |
|
sed 's/"[ ]*$//' |
|
||||||
sed 's/\\"/"/g'
|
sed 's/\\"/"/g'
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fallback for unquoted values (e.g., numeric IDs)
|
# Fallback for unquoted values (e.g., numeric IDs)
|
||||||
unquoted_match="$(printf "%s" "$input" | _egrep_o "\"$key\"[[:space:]]*:[[:space:]]*[^,}]*" | _head_n 1)"
|
unquoted_match="$(printf "%s" "$input" | _egrep_o "\"$key\"[ ]*:[ ]*[^,}]*" | _head_n 1)"
|
||||||
if [ -n "$unquoted_match" ]; then
|
if [ -n "$unquoted_match" ]; then
|
||||||
printf "%s" "$unquoted_match" |
|
printf "%s" "$unquoted_match" |
|
||||||
cut -d : -f2- |
|
cut -d : -f2- |
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ dns_infoblox_uddi_rm() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
record_id=$(echo "$response" | _egrep_o '"id":[[:space:]]*"[^"]*"' | _head_n 1 | cut -d '"' -f 4)
|
record_id=$(echo "$response" | _egrep_o '"id":[ ]*"[^"]*"' | _head_n 1 | cut -d '"' -f 4)
|
||||||
_debug "record_id" "$record_id"
|
_debug "record_id" "$record_id"
|
||||||
|
|
||||||
if [ -z "$record_id" ]; then
|
if [ -z "$record_id" ]; then
|
||||||
@@ -178,7 +178,7 @@ _get_root() {
|
|||||||
# Check if response contains results (even if empty)
|
# Check if response contains results (even if empty)
|
||||||
if _contains "$response" '"results"'; then
|
if _contains "$response" '"results"'; then
|
||||||
# Extract zone ID - must match the pattern dns/auth_zone/...
|
# Extract zone ID - must match the pattern dns/auth_zone/...
|
||||||
zone_id=$(echo "$response" | _egrep_o '"id":[[:space:]]*"dns/auth_zone/[^"]*"' | _head_n 1 | cut -d '"' -f 4)
|
zone_id=$(echo "$response" | _egrep_o '"id":[ ]*"dns/auth_zone/[^"]*"' | _head_n 1 | cut -d '"' -f 4)
|
||||||
if [ -n "$zone_id" ]; then
|
if [ -n "$zone_id" ]; then
|
||||||
# Found the zone
|
# Found the zone
|
||||||
_domain="$h"
|
_domain="$h"
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ _poweradmin_rest() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if printf '%s' "$response" | grep -q '"success"[[:space:]]*:[[:space:]]*false'; then
|
if printf '%s' "$response" | grep -q '"success"[ ]*:[ ]*false'; then
|
||||||
_err "API reported failure on $method $ep"
|
_err "API reported failure on $method $ep"
|
||||||
_debug "Response: $response"
|
_debug "Response: $response"
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ dns_rage4_rm() {
|
|||||||
_debug "Getting txt records"
|
_debug "Getting txt records"
|
||||||
_rage4_rest "getrecords/?id=${_domain_id}"
|
_rage4_rest "getrecords/?id=${_domain_id}"
|
||||||
|
|
||||||
_record_id=$(echo "$response" | tr '{' '\n' | grep '"TXT"' | grep "\"$txtvalue" | sed -rn 's/.*"id":([[:digit:]]+),.*/\1/p')
|
_record_id=$(echo "$response" | tr '{' '\n' | grep '"TXT"' | grep "\"$txtvalue" | sed -n 's/.*"id":\([0-9][0-9]*\),.*/\1/p')
|
||||||
if [ -z "$_record_id" ]; then
|
if [ -z "$_record_id" ]; then
|
||||||
_err "error retrieving the record_id of the new TXT record in order to delete it, got: '$_record_id'."
|
_err "error retrieving the record_id of the new TXT record in order to delete it, got: '$_record_id'."
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ _get_auth_token() {
|
|||||||
_data_auth="{\"auth\":{\"identity\":{\"methods\":[\"password\"],\"password\":{\"user\":{\"name\":\"${SL_Login_Name}\",\"domain\":{\"name\":\"${SL_Login_ID}\"},\"password\":\"${SL_Pswd}\"}}},\"scope\":{\"project\":{\"name\":\"${SL_Project_Name}\",\"domain\":{\"name\":\"${SL_Login_ID}\"}}}}}"
|
_data_auth="{\"auth\":{\"identity\":{\"methods\":[\"password\"],\"password\":{\"user\":{\"name\":\"${SL_Login_Name}\",\"domain\":{\"name\":\"${SL_Login_ID}\"},\"password\":\"${SL_Pswd}\"}}},\"scope\":{\"project\":{\"name\":\"${SL_Project_Name}\",\"domain\":{\"name\":\"${SL_Login_ID}\"}}}}}"
|
||||||
export _H1="Content-Type: application/json"
|
export _H1="Content-Type: application/json"
|
||||||
_result=$(_post "$_data_auth" "$auth_uri")
|
_result=$(_post "$_data_auth" "$auth_uri")
|
||||||
_token_keystone=$(grep 'x-subject-token' "$HTTP_HEADER" | sed -nE "s/[[:space:]]*x-subject-token:[[:space:]]*([[:print:]]*)(\r*)/\1/p")
|
_token_keystone=$(grep 'x-subject-token' "$HTTP_HEADER" | cut -d ':' -f 2- | tr -d ' \t\r')
|
||||||
_dt_curr=$(date +%s)
|
_dt_curr=$(date +%s)
|
||||||
SL_Token_V2="${SL_Login_Name}${_sl_sep}${_token_keystone}${_sl_sep}${SL_Login_ID}${_sl_sep}${SL_Project_Name}${_sl_sep}${_dt_curr}"
|
SL_Token_V2="${SL_Login_Name}${_sl_sep}${_token_keystone}${_sl_sep}${SL_Login_ID}${_sl_sep}${SL_Project_Name}${_sl_sep}${_dt_curr}"
|
||||||
_saveaccountconf_mutable SL_Token_V2 "$SL_Token_V2"
|
_saveaccountconf_mutable SL_Token_V2 "$SL_Token_V2"
|
||||||
|
|||||||
@@ -42,7 +42,10 @@ dns_selfhost_add() {
|
|||||||
# only match full domains (at the beginning of the string or with a leading whitespace),
|
# only match full domains (at the beginning of the string or with a leading whitespace),
|
||||||
# e.g. don't match mytest.example.com or sub.test.example.com for test.example.com
|
# e.g. don't match mytest.example.com or sub.test.example.com for test.example.com
|
||||||
# if the domain is defined multiple times only the last occurance will be matched
|
# if the domain is defined multiple times only the last occurance will be matched
|
||||||
mapEntry=$(echo "$SELFHOSTDNS_MAP" | sed -n -E "s/(^|^.*[[:space:]])($fulldomain)(:[[:digit:]]+)([:]?[[:digit:]]*)(.*)/\2\3\4/p")
|
# prepend a space to each line so "start of line" and "after whitespace"
|
||||||
|
# can both be matched as "after a space/tab" (portable BRE, no ERE (^|..))
|
||||||
|
_selfhost_tab="$(printf '\t')"
|
||||||
|
mapEntry=$(echo "$SELFHOSTDNS_MAP" | sed 's/^/ /' | sed -n "s/.*[ $_selfhost_tab]\($fulldomain:[0-9][0-9]*:\{0,1\}[0-9]*\).*/\1/p")
|
||||||
_debug2 mapEntry "$mapEntry"
|
_debug2 mapEntry "$mapEntry"
|
||||||
if test -z "$mapEntry"; then
|
if test -z "$mapEntry"; then
|
||||||
_err "SELFHOSTDNS_MAP must contain the fulldomain incl. prefix and at least one RID"
|
_err "SELFHOSTDNS_MAP must contain the fulldomain incl. prefix and at least one RID"
|
||||||
@@ -54,7 +57,7 @@ dns_selfhost_add() {
|
|||||||
rid2=$(echo "$mapEntry" | cut -d: -f3)
|
rid2=$(echo "$mapEntry" | cut -d: -f3)
|
||||||
|
|
||||||
# read last used rid domain
|
# read last used rid domain
|
||||||
lastUsedRidForDomainEntry=$(echo "$SELFHOSTDNS_MAP_LAST_USED_INTERNAL" | sed -n -E "s/(^|^.*[[:space:]])($fulldomain:[[:digit:]]+)(.*)/\2/p")
|
lastUsedRidForDomainEntry=$(echo "$SELFHOSTDNS_MAP_LAST_USED_INTERNAL" | sed 's/^/ /' | sed -n "s/.*[ $_selfhost_tab]\($fulldomain:[0-9][0-9]*\).*/\1/p")
|
||||||
_debug2 lastUsedRidForDomainEntry "$lastUsedRidForDomainEntry"
|
_debug2 lastUsedRidForDomainEntry "$lastUsedRidForDomainEntry"
|
||||||
lastUsedRidForDomain=$(echo "$lastUsedRidForDomainEntry" | cut -d: -f2)
|
lastUsedRidForDomain=$(echo "$lastUsedRidForDomainEntry" | cut -d: -f2)
|
||||||
|
|
||||||
|
|||||||
@@ -145,8 +145,8 @@ _udr_rest() {
|
|||||||
_debug data "${data}"
|
_debug data "${data}"
|
||||||
response="$(_post "${data}" "${UDR_API}?s_login=${UDR_USER}&s_pw=${UDR_PASS}" "" "POST")"
|
response="$(_post "${data}" "${UDR_API}?s_login=${UDR_USER}&s_pw=${UDR_PASS}" "" "POST")"
|
||||||
|
|
||||||
_code=$(echo "$response" | _egrep_o "code = ([0-9]+)" | _head_n 1 | cut -d = -f 2 | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
_code=$(echo "$response" | _egrep_o "code = ([0-9]+)" | _head_n 1 | cut -d = -f 2 | tr -d ' \t\r')
|
||||||
_description=$(echo "$response" | _egrep_o "description = .*" | _head_n 1 | cut -d = -f 2 | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
_description=$(echo "$response" | _egrep_o "description = .*" | _head_n 1 | cut -d = -f 2 | tr -d '\r' | sed -e 's/^[ ]*//' -e 's/[ ]*$//')
|
||||||
|
|
||||||
_debug response_code "$_code"
|
_debug response_code "$_code"
|
||||||
_debug response_description "$_description"
|
_debug response_description "$_description"
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ _check_variables() {
|
|||||||
org_response="$(echo "$org_response" | _normalizeJson)"
|
org_response="$(echo "$org_response" | _normalizeJson)"
|
||||||
YANDEX360_ORG_ID=$(
|
YANDEX360_ORG_ID=$(
|
||||||
echo "$org_response" |
|
echo "$org_response" |
|
||||||
_egrep_o '"id":[[:space:]]*[0-9]+' |
|
_egrep_o '"id":[ ]*[0-9]+' |
|
||||||
cut -d':' -f2
|
cut -d':' -f2
|
||||||
)
|
)
|
||||||
_debug 'Automatically retrieved YANDEX360_ORG_ID' "$YANDEX360_ORG_ID"
|
_debug 'Automatically retrieved YANDEX360_ORG_ID' "$YANDEX360_ORG_ID"
|
||||||
@@ -216,7 +216,7 @@ _get_token() {
|
|||||||
|
|
||||||
interval=$(
|
interval=$(
|
||||||
echo "$response" |
|
echo "$response" |
|
||||||
_egrep_o '"interval":[[:space:]]*[0-9]+' |
|
_egrep_o '"interval":[ ]*[0-9]+' |
|
||||||
cut -d':' -f2
|
cut -d':' -f2
|
||||||
)
|
)
|
||||||
_debug 'Polling interval' "$interval"
|
_debug 'Polling interval' "$interval"
|
||||||
|
|||||||
Reference in New Issue
Block a user