From c86631b40c99a083155f8815d3d0aaaa6dbdf264 Mon Sep 17 00:00:00 2001 From: neilpang Date: Fri, 4 Oct 2019 13:31:09 +0800 Subject: [PATCH] json decode the directory content --- acme.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/acme.sh b/acme.sh index 041b5b4..6f17c44 100755 --- a/acme.sh +++ b/acme.sh @@ -814,6 +814,11 @@ _json_encode() { echo "$_j_str" | _hex_dump | _lower_case | sed 's/0a/5c 6e/g' | tr -d ' ' | _h2b | tr -d "\r\n" } +#convert '\/' to '\' +_json_decode() { + sed 's#\\/#/#g' +} + #options file _sed_i() { options="$1" @@ -2395,7 +2400,7 @@ _initAPI() { _debug "_init api for server: $_api_server" if [ -z "$ACME_NEW_ACCOUNT" ]; then - response=$(_get "$_api_server") + response=$(_get "$_api_server" | _json_decode) if [ "$?" != "0" ]; then _debug2 "response" "$response" _err "Can not init api."