mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-01-16 13:22:08 +08:00
run ~/shfmt -l -w -i 2 dnsapi/dns_virakcloud.sh and Remove unnecessary blank lines in dns_virakcloud.sh
This commit is contained in:
@@ -43,7 +43,6 @@ dns_virakcloud_add() {
|
|||||||
|
|
||||||
_info "Adding TXT record"
|
_info "Adding TXT record"
|
||||||
|
|
||||||
|
|
||||||
if _virakcloud_rest POST "domains/${_domain}/records" "{\"record\":\"${fulldomain}\",\"type\":\"TXT\",\"ttl\":3600,\"content\":\"${txtvalue}\"}"; then
|
if _virakcloud_rest POST "domains/${_domain}/records" "{\"record\":\"${fulldomain}\",\"type\":\"TXT\",\"ttl\":3600,\"content\":\"${txtvalue}\"}"; then
|
||||||
if echo "$response" | grep -q "success" || echo "$response" | grep -q "\"data\""; then
|
if echo "$response" | grep -q "success" || echo "$response" | grep -q "\"data\""; then
|
||||||
_info "Added, OK"
|
_info "Added, OK"
|
||||||
@@ -101,11 +100,11 @@ dns_virakcloud_rm() {
|
|||||||
contentid=""
|
contentid=""
|
||||||
# Extract innermost objects (content objects) which look like {"id":"...","content_raw":"..."}
|
# Extract innermost objects (content objects) which look like {"id":"...","content_raw":"..."}
|
||||||
# We filter for the one containing txtvalue
|
# We filter for the one containing txtvalue
|
||||||
|
|
||||||
target_obj=$(echo "$response" | grep -o '{[^}]*}' | grep "$txtvalue" | _head_n 1)
|
target_obj=$(echo "$response" | grep -o '{[^}]*}' | grep "$txtvalue" | _head_n 1)
|
||||||
|
|
||||||
if [ -n "$target_obj" ]; then
|
if [ -n "$target_obj" ]; then
|
||||||
contentid=$(echo "$target_obj" | _egrep_o '"id":"[^"]*"' | cut -d '"' -f 4)
|
contentid=$(echo "$target_obj" | _egrep_o '"id":"[^"]*"' | cut -d '"' -f 4)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$contentid" ]; then
|
if [ -z "$contentid" ]; then
|
||||||
@@ -197,7 +196,7 @@ _virakcloud_rest() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
_ret="$?"
|
_ret="$?"
|
||||||
|
|
||||||
if [ "$_ret" != "0" ]; then
|
if [ "$_ret" != "0" ]; then
|
||||||
_err "error on $m $ep"
|
_err "error on $m $ep"
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user