Browse Source

Fix shellcheck and shfmt

pull/4267/head
Viktor Sokhan 2 years ago
parent
commit
4e5d4b9695
  1. 4
      dnsapi/dns_yc.sh

4
dnsapi/dns_yc.sh

@ -155,7 +155,7 @@ _get_root() {
if ! _yc_rest GET "zones/$YC_Zone_ID"; then if ! _yc_rest GET "zones/$YC_Zone_ID"; then
return 1 return 1
else else
if echo "$response" | tr -d " " | grep \"id\":\"$YC_Zone_ID\" >/dev/null; then
if echo "$response" | tr -d " " | _egrep_o "\"id\":\"$YC_Zone_ID\"" >/dev/null; then
_domain=$(echo "$response" | _egrep_o "\"zone\": *\"[^\"]*\"" | cut -d : -f 2 | tr -d \" | _head_n 1 | tr -d " ") _domain=$(echo "$response" | _egrep_o "\"zone\": *\"[^\"]*\"" | cut -d : -f 2 | tr -d \" | _head_n 1 | tr -d " ")
if [ "$_domain" ]; then if [ "$_domain" ]; then
_cutlength=$((${#domain} - ${#_domain})) _cutlength=$((${#domain} - ${#_domain}))
@ -240,7 +240,7 @@ _yc_login() {
_debug header "$header" _debug header "$header"
_current_timestamp=$(_time) _current_timestamp=$(_time)
_expire_timestamp=$(_math $_current_timestamp + 1200) # 20 minutes
_expire_timestamp=$(_math "$_current_timestamp" + 1200) # 20 minutes
payload=$(echo "{\"iss\":\"$YC_SA_ID\",\"aud\":\"https://iam.api.cloud.yandex.net/iam/v1/tokens\",\"iat\":$_current_timestamp,\"exp\":$_expire_timestamp}" | _normalizeJson | _base64 | _url_replace) payload=$(echo "{\"iss\":\"$YC_SA_ID\",\"aud\":\"https://iam.api.cloud.yandex.net/iam/v1/tokens\",\"iat\":$_current_timestamp,\"exp\":$_expire_timestamp}" | _normalizeJson | _base64 | _url_replace)
_debug payload "$payload" _debug payload "$payload"

Loading…
Cancel
Save