fix shellcheck warnings

This commit is contained in:
neilpang
2016-11-11 23:30:14 +08:00
parent 031e885e4d
commit c7b16249b8
10 changed files with 108 additions and 108 deletions

View File

@@ -26,7 +26,7 @@ dns_gd_add() {
_saveaccountconf GD_Secret "$GD_Secret"
_debug "First detect the root zone"
if ! _get_root $fulldomain; then
if ! _get_root "$fulldomain"; then
_err "invalid domain"
return 1
fi
@@ -67,8 +67,8 @@ _get_root() {
domain=$1
i=2
p=1
while [ '1' ]; do
h=$(printf $domain | cut -d . -f $i-100)
while true; do
h=$(printf "%s" "$domain" | cut -d . -f $i-100)
if [ -z "$h" ]; then
#not valid
return 1
@@ -78,11 +78,11 @@ _get_root() {
return 1
fi
if printf "$response" | grep '"code":"NOT_FOUND"' >/dev/null; then
if _contains "$response" '"code":"NOT_FOUND"'; then
_debug "$h not found"
else
_sub_domain=$(printf $domain | cut -d . -f 1-$p)
_domain=$h
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
_domain="$h"
return 0
fi
p=$i
@@ -95,7 +95,7 @@ _gd_rest() {
m=$1
ep="$2"
data="$3"
_debug $ep
_debug "$ep"
_H1="Authorization: sso-key $GD_Key:$GD_Secret"
_H2="Content-Type: application/json"