From 16d79ebaac40d1e026ee0d63a63ea5e160872a7c Mon Sep 17 00:00:00 2001 From: neilpang Date: Sun, 20 Nov 2016 23:04:28 +0800 Subject: [PATCH] fix format --- acme.sh | 2 +- dnsapi/dns_aws.sh | 28 +++++----------------------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/acme.sh b/acme.sh index 36492cb..63ec7d4 100755 --- a/acme.sh +++ b/acme.sh @@ -335,7 +335,7 @@ _hex() { _str_len=${#_str} _h_i=1 while [ "$_h_i" -le "$_str_len" ]; do - _str_c="$(printf "%s" "$_str" | cut -c "$_h_i" )" + _str_c="$(printf "%s" "$_str" | cut -c "$_h_i")" printf "%02x" "'$_str_c" _h_i="$(_math "$_h_i" + 1)" done diff --git a/dnsapi/dns_aws.sh b/dnsapi/dns_aws.sh index ecf1156..c0ab72d 100644 --- a/dnsapi/dns_aws.sh +++ b/dnsapi/dns_aws.sh @@ -40,31 +40,28 @@ dns_aws_add() { _debug _domain "$_domain" _aws_tmpl_xml="UPSERT$fulldomainTXT300\"$txtvalue\"" - + if aws_rest POST "2013-04-01$_domain_id/rrset/" "" "$_aws_tmpl_xml" && _contains "$response" "ChangeResourceRecordSetsResponse"; then _info "txt record updated sucess." return 0 fi - return 1; + return 1 } - - #fulldomain dns_aws_rm() { fulldomain=$1 } - #################### Private functions bellow ################################## _get_root() { domain=$1 i=2 p=1 - + if aws_rest GET "2013-04-01/hostedzone"; then _debug "response" "$response" while true; do @@ -96,7 +93,6 @@ _get_root() { return 1 } - #method uri qstr data aws_rest() { mtd="$1" @@ -137,13 +133,13 @@ aws_rest() { CanonicalRequest="$mtd\n$CanonicalURI\n$CanonicalQueryString\n$CanonicalHeaders\n$SignedHeaders\n$(printf "%s" "$RequestPayload" | _digest "$Hash" hex)" _debug2 CanonicalRequest "$CanonicalRequest" - HashedCanonicalRequest="$(printf "$CanonicalRequest%s" | _digest "$Hash" hex )" + HashedCanonicalRequest="$(printf "$CanonicalRequest%s" | _digest "$Hash" hex)" _debug2 HashedCanonicalRequest "$HashedCanonicalRequest" Algorithm="AWS4-HMAC-SHA256" _debug2 Algorithm "$Algorithm" - RequestDateOnly="$(echo "$RequestDate" | cut -c 1-8 )" + RequestDateOnly="$(echo "$RequestDate" | cut -c 1-8)" _debug2 RequestDateOnly "$RequestDateOnly" Region="us-east-1" @@ -204,17 +200,3 @@ aws_rest() { return "$_ret" } - - - - - - - - - - - - - -