Skip to content

Commit e17da43

Browse files
committed
fix: adjust shell format with shfmt
1 parent 9aeca8f commit e17da43

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

dnsapi/dns_mvmnet.sh

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ else ## LIVE
1616
MVMNET_API_URL="https://api.mvmnet.com/api/1.0"
1717
fi
1818

19-
2019
######## Public functions #####################
2120

2221
dns_mvmnet_add() {
@@ -63,7 +62,6 @@ dns_mvmnet_rm() {
6362
_subdomain=$(echo "$fulldomain" | sed -r "s/.$_domain//")
6463
_debug _subdomain "$_subdomain"
6564

66-
6765
if ! _get_record_id "$_subdomain" "$_domain" "$txtvalue"; then
6866
_warn "Record id for $_subdomain not found, please remove it manually"
6967
return 0
@@ -84,8 +82,7 @@ dns_mvmnet_rm() {
8482

8583
#################### Private functions below ##################################
8684

87-
_check_variables ()
88-
{
85+
_check_variables() {
8986
MVMNET_ID="${MVMNET_ID:-$(_readaccountconf_mutable MVMNET_ID)}"
9087
MVMNET_KEY="${MVMNET_KEY:-$(_readaccountconf_mutable MVMNET_KEY)}"
9188
MVMNET_SEED="${MVMNET_SEED:-$(_readaccountconf_mutable MVMNET_SEED)}"
@@ -98,8 +95,7 @@ _check_variables ()
9895
fi
9996
}
10097

101-
_retrieve_and_check_variables ()
102-
{
98+
_retrieve_and_check_variables() {
10399
_check_variables
104100

105101
_saveaccountconf_mutable MVMNET_ID "$MVMNET_ID"
@@ -112,8 +108,7 @@ _retrieve_and_check_variables ()
112108
# _sub_domain=_acme-challenge.www
113109
# _domain=domain.com
114110
# _domain_id=123456789
115-
_get_root ()
116-
{
111+
_get_root() {
117112
domain=$1
118113
i=1
119114
p=1
@@ -131,7 +126,7 @@ _get_root ()
131126
return 1
132127
fi
133128

134-
if _contains "$response" "\"domain_idn\":\"$h\"" ; then
129+
if _contains "$response" "\"domain_idn\":\"$h\""; then
135130
_domain_id=$(echo "$response" | _egrep_o ".\"id\": *\"[0-9]*\"" | _head_n 1 | cut -d : -f 2 | tr -d \" | tr -d " ")
136131
if [ "$_domain_id" ]; then
137132
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
@@ -193,8 +188,8 @@ _mvmnet_rest() {
193188
data="$3"
194189
_debug "$ep"
195190

196-
MVMNET_ID="${MVMNET_ID:-$(_readaccountconf_mutable MVMNET_ID)}" ## Case sensitive
197-
MVMNET_KEY="${MVMNET_KEY:-$(_readaccountconf_mutable MVMNET_KEY)}" ## Case sensitive
191+
MVMNET_ID="${MVMNET_ID:-$(_readaccountconf_mutable MVMNET_ID)}" ## Case sensitive
192+
MVMNET_KEY="${MVMNET_KEY:-$(_readaccountconf_mutable MVMNET_KEY)}" ## Case sensitive
198193
MVMNET_SEED="${MVMNET_SEED:-$(_readaccountconf_mutable MVMNET_SEED)}" ## Case sensitive
199194

200195
signature="$(printf "%s" "${MVMNET_ID}+${MVMNET_KEY}+$m+${MVMNET_SEED}" | _digest "sha1" "hex")"
@@ -203,16 +198,16 @@ _mvmnet_rest() {
203198
export _H2="X-Mvm-Signature: ${signature}"
204199

205200
case "$m" in
206-
POST|PUT)
207-
_debug data "$data"
208-
response="$(_post "$data" "$MVMNET_API_URL/$ep" "" "$m" "application/json")"
209-
;;
210-
DELETE)
211-
response="$(_post "" "$MVMNET_API_URL/$ep?$data" "" "$m")"
212-
;;
213-
GET)
214-
response="$(_get "$MVMNET_API_URL/$ep?$data")"
215-
;;
201+
POST | PUT)
202+
_debug data "$data"
203+
response="$(_post "$data" "$MVMNET_API_URL/$ep" "" "$m" "application/json")"
204+
;;
205+
DELETE)
206+
response="$(_post "" "$MVMNET_API_URL/$ep?$data" "" "$m")"
207+
;;
208+
GET)
209+
response="$(_get "$MVMNET_API_URL/$ep?$data")"
210+
;;
216211
esac
217212

218213
if [ "$?" != "0" ]; then

0 commit comments

Comments
 (0)