diff --git a/.travis.yml b/.travis.yml
index fd4ee25c..1fff02e5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -41,7 +41,7 @@ script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ~/shfmt -l -w -i 2 . ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git diff --exit-code && echo "shfmt OK" ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then shellcheck -V ; fi
- - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then shellcheck -e SC2126,SC2034 **/*.sh && echo "shellcheck OK" ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then shellcheck **/*.sh && echo "shellcheck OK" ; fi
- cd ..
- git clone https://github.com/Neilpang/acmetest.git && cp -r acme.sh acmetest/ && cd acmetest
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$NGROK_TOKEN" ]]; then sudo NGROK_TOKEN="$NGROK_TOKEN" ./letest.sh ; fi
diff --git a/dnsapi/dns_ad.sh b/dnsapi/dns_ad.sh
index 1c7e85f9..fc4a664b 100644
--- a/dnsapi/dns_ad.sh
+++ b/dnsapi/dns_ad.sh
@@ -127,8 +127,8 @@ _ad_rest() {
_debug mtd "$mtd"
_debug ep "$ep"
- _H1="Accept: application/json"
- _H2="Content-Type: application/json"
+ export _H1="Accept: application/json"
+ export _H2="Content-Type: application/json"
if [ "$mtd" != "GET" ]; then
# both POST and DELETE.
diff --git a/dnsapi/dns_aws.sh b/dnsapi/dns_aws.sh
index 38b03cd4..59ef6181 100644
--- a/dnsapi/dns_aws.sh
+++ b/dnsapi/dns_aws.sh
@@ -137,13 +137,13 @@ aws_rest() {
#RequestDate="20161120T141056Z" ##############
- _H1="x-amz-date: $RequestDate"
+ export _H1="x-amz-date: $RequestDate"
aws_host="$AWS_HOST"
CanonicalHeaders="host:$aws_host\nx-amz-date:$RequestDate\n"
SignedHeaders="host;x-amz-date"
if [ -n "$AWS_SESSION_TOKEN" ]; then
- _H2="x-amz-security-token: $AWS_SESSION_TOKEN"
+ export _H2="x-amz-security-token: $AWS_SESSION_TOKEN"
CanonicalHeaders="${CanonicalHeaders}x-amz-security-token:$AWS_SESSION_TOKEN\n"
SignedHeaders="${SignedHeaders};x-amz-security-token"
fi
diff --git a/dnsapi/dns_cf.sh b/dnsapi/dns_cf.sh
index 0b817d36..3718f9db 100755
--- a/dnsapi/dns_cf.sh
+++ b/dnsapi/dns_cf.sh
@@ -163,9 +163,9 @@ _cf_rest() {
data="$3"
_debug "$ep"
- _H1="X-Auth-Email: $CF_Email"
- _H2="X-Auth-Key: $CF_Key"
- _H3="Content-Type: application/json"
+ export _H1="X-Auth-Email: $CF_Email"
+ export _H2="X-Auth-Key: $CF_Key"
+ export _H3="Content-Type: application/json"
if [ "$m" != "GET" ]; then
_debug data "$data"
diff --git a/dnsapi/dns_cx.sh b/dnsapi/dns_cx.sh
index dfc838ae..9c032fd7 100755
--- a/dnsapi/dns_cx.sh
+++ b/dnsapi/dns_cx.sh
@@ -193,10 +193,10 @@ _rest() {
hmac=$(printf "%s" "$sec" | _digest md5 hex)
_debug hmac "$hmac"
- _H1="API-KEY: $CX_Key"
- _H2="API-REQUEST-DATE: $cdate"
- _H3="API-HMAC: $hmac"
- _H4="Content-Type: application/json"
+ export _H1="API-KEY: $CX_Key"
+ export _H2="API-REQUEST-DATE: $cdate"
+ export _H3="API-HMAC: $hmac"
+ export _H4="Content-Type: application/json"
if [ "$data" ]; then
response="$(_post "$data" "$url" "" "$m")"
diff --git a/dnsapi/dns_dp.sh b/dnsapi/dns_dp.sh
index 06833b4b..6608d9cf 100755
--- a/dnsapi/dns_dp.sh
+++ b/dnsapi/dns_dp.sh
@@ -102,7 +102,7 @@ existing_records() {
fi
if _contains "$response" "Action completed successful"; then
- count=$(printf "%s" "$response" | grep 'TXT' | wc -l | tr -d ' ')
+ count=$(printf "%s" "$response" | grep -c 'TXT' | tr -d ' ')
record_id=$(printf "%s" "$response" | grep '^' | tail -1 | cut -d '>' -f 2 | cut -d '<' -f 1)
_debug record_id "$record_id"
return 0
@@ -199,15 +199,20 @@ _get_root() {
#Usage: method URI data
_rest() {
- m=$1
+<<<<<<< HEAD
+ m="$1" # method e.g. GET|POST|PUT|DELETE
+=======
+ export m=$1 # e.g. GET|POST
+>>>>>>> db75015a49bba555cd1f46de00a9fbf9a07aa562
ep="$2"
data="$3"
+
_debug "$ep"
url="$REST_API/$ep"
_debug url "$url"
- if [ "$data" ]; then
+ if [ "$m" != 'GET' -a "$data" ]; then
_debug2 data "$data"
response="$(_post "$data" "$url" | tr -d '\r')"
else
diff --git a/dnsapi/dns_gd.sh b/dnsapi/dns_gd.sh
index 81000561..1abeeacf 100755
--- a/dnsapi/dns_gd.sh
+++ b/dnsapi/dns_gd.sh
@@ -98,8 +98,8 @@ _gd_rest() {
data="$3"
_debug "$ep"
- _H1="Authorization: sso-key $GD_Key:$GD_Secret"
- _H2="Content-Type: application/json"
+ export _H1="Authorization: sso-key $GD_Key:$GD_Secret"
+ export _H2="Content-Type: application/json"
if [ "$data" ]; then
_debug data "$data"
diff --git a/dnsapi/dns_ispconfig.sh b/dnsapi/dns_ispconfig.sh
index a84d95d7..6d1f34c5 100755
--- a/dnsapi/dns_ispconfig.sh
+++ b/dnsapi/dns_ispconfig.sh
@@ -46,7 +46,7 @@ _ISPC_credentials() {
_saveaccountconf ISPC_Api "${ISPC_Api}"
_saveaccountconf ISPC_Api_Insecure "${ISPC_Api_Insecure}"
# Set whether curl should use secure or insecure mode
- HTTPS_INSECURE="${ISPC_Api_Insecure}"
+ export HTTPS_INSECURE="${ISPC_Api_Insecure}"
fi
}
diff --git a/dnsapi/dns_lexicon.sh b/dnsapi/dns_lexicon.sh
index 0398bd2e..a544b999 100755
--- a/dnsapi/dns_lexicon.sh
+++ b/dnsapi/dns_lexicon.sh
@@ -2,8 +2,7 @@
# dns api wrapper of lexicon for acme.sh
-lexicon_url="https://github.com/AnalogJ/lexicon"
-lexicon_cmd="lexicon"
+lexicon_cmd="lexicon" # https://github.com/AnalogJ/lexicon
wiki="https://github.com/Neilpang/acme.sh/wiki/How-to-use-lexicon-dns-api"
diff --git a/dnsapi/dns_lua.sh b/dnsapi/dns_lua.sh
index bc06b3ef..47f4497a 100755
--- a/dnsapi/dns_lua.sh
+++ b/dnsapi/dns_lua.sh
@@ -125,8 +125,8 @@ _LUA_rest() {
data="$3"
_debug "$ep"
- _H1="Accept: application/json"
- _H2="Authorization: Basic $LUA_auth"
+ export _H1="Accept: application/json"
+ export _H2="Authorization: Basic $LUA_auth"
if [ "$data" ]; then
_debug data "$data"
response="$(_post "$data" "$LUA_Api/$ep" "" "$m")"
diff --git a/dnsapi/dns_me.sh b/dnsapi/dns_me.sh
index c94a3c90..9fe6baf8 100755
--- a/dnsapi/dns_me.sh
+++ b/dnsapi/dns_me.sh
@@ -126,9 +126,9 @@ _me_rest() {
cdate=$(date -u +"%a, %d %b %Y %T %Z")
hmac=$(printf "%s" "$cdate" | _hmac sha1 "$(_hex "$ME_Secret")" hex)
- _H1="x-dnsme-apiKey: $ME_Key"
- _H2="x-dnsme-requestDate: $cdate"
- _H3="x-dnsme-hmac: $hmac"
+ export _H1="x-dnsme-apiKey: $ME_Key"
+ export _H2="x-dnsme-requestDate: $cdate"
+ export _H3="x-dnsme-hmac: $hmac"
if [ "$data" ]; then
_debug data "$data"
diff --git a/dnsapi/dns_ovh.sh b/dnsapi/dns_ovh.sh
index 18b9c341..8833c0a1 100755
--- a/dnsapi/dns_ovh.sh
+++ b/dnsapi/dns_ovh.sh
@@ -273,12 +273,12 @@ _ovh_rest() {
_ovh_hex="$(printf "%s" "$_ovh_p" | _digest sha1 hex)"
_debug2 _ovh_hex "$_ovh_hex"
- _H1="X-Ovh-Application: $OVH_AK"
- _H2="X-Ovh-Signature: \$1\$$_ovh_hex"
+ export _H1="X-Ovh-Application: $OVH_AK"
+ export _H2="X-Ovh-Signature: \$1\$$_ovh_hex"
_debug2 _H2 "$_H2"
- _H3="X-Ovh-Timestamp: $_ovh_t"
- _H4="X-Ovh-Consumer: $OVH_CK"
- _H5="Content-Type: application/json;charset=utf-8"
+ export _H3="X-Ovh-Timestamp: $_ovh_t"
+ export _H4="X-Ovh-Consumer: $OVH_CK"
+ export _H5="Content-Type: application/json;charset=utf-8"
if [ "$data" ] || [ "$m" = "POST" ] || [ "$m" = "PUT" ]; then
_debug data "$data"
response="$(_post "$data" "$_ovh_url" "" "$m")"
diff --git a/dnsapi/dns_pdns.sh b/dnsapi/dns_pdns.sh
index 06763d88..ebc02949 100755
--- a/dnsapi/dns_pdns.sh
+++ b/dnsapi/dns_pdns.sh
@@ -165,7 +165,7 @@ _pdns_rest() {
ep=$2
data=$3
- _H1="X-API-Key: $PDNS_Token"
+ export _H1="X-API-Key: $PDNS_Token"
if [ ! "$method" = "GET" ]; then
_debug data "$data"