diff --git a/dnsapi/dns_gandi_livedns.sh b/dnsapi/dns_gandi_livedns.sh
index cdda4775..87119521 100644
--- a/dnsapi/dns_gandi_livedns.sh
+++ b/dnsapi/dns_gandi_livedns.sh
@@ -69,9 +69,9 @@ dns_gandi_livedns_rm() {
_gandi_livedns_rest PUT \
"domains/$_domain/records/$_sub_domain/TXT" \
- "{\"rrset_ttl\": 300, \"rrset_values\": $_new_rrset_values}" \
- && _contains "$response" '{"message": "DNS Record Created"}' \
- && _info "Removing record $(__green "success")"
+ "{\"rrset_ttl\": 300, \"rrset_values\": $_new_rrset_values}" &&
+ _contains "$response" '{"message": "DNS Record Created"}' &&
+ _info "Removing record $(__green "success")"
}
#################### Private functions below ##################################
@@ -125,9 +125,9 @@ _dns_gandi_append_record() {
fi
_debug new_rrset_values "$_rrset_values"
_gandi_livedns_rest PUT "domains/$_domain/records/$sub_domain/TXT" \
- "{\"rrset_ttl\": 300, \"rrset_values\": $_rrset_values}" \
- && _contains "$response" '{"message": "DNS Record Created"}' \
- && _info "Adding record $(__green "success")"
+ "{\"rrset_ttl\": 300, \"rrset_values\": $_rrset_values}" &&
+ _contains "$response" '{"message": "DNS Record Created"}' &&
+ _info "Adding record $(__green "success")"
}
_dns_gandi_existing_rrset_values() {
@@ -145,8 +145,8 @@ _dns_gandi_existing_rrset_values() {
return 1
fi
_debug "Already has TXT record."
- _rrset_values=$(echo "$response" | _egrep_o 'rrset_values.*\[.*\]' \
- | _egrep_o '\[".*\"]')
+ _rrset_values=$(echo "$response" | _egrep_o 'rrset_values.*\[.*\]' |
+ _egrep_o '\[".*\"]')
return 0
}
diff --git a/dnsapi/dns_gcloud.sh b/dnsapi/dns_gcloud.sh
index 6365b338..03060a8c 100755
--- a/dnsapi/dns_gcloud.sh
+++ b/dnsapi/dns_gcloud.sh
@@ -78,8 +78,8 @@ _dns_gcloud_execute_tr() {
for i in $(seq 1 120); do
if gcloud dns record-sets changes list \
--zone="$managedZone" \
- --filter='status != done' \
- | grep -q '^.*'; then
+ --filter='status != done' |
+ grep -q '^.*'; then
_info "_dns_gcloud_execute_tr: waiting for transaction to be comitted ($i/120)..."
sleep 5
else
@@ -137,11 +137,11 @@ _dns_gcloud_find_zone() {
# List domains and find the zone with the deepest sub-domain (in case of some levels of delegation)
if ! match=$(gcloud dns managed-zones list \
--format="value(name, dnsName)" \
- --filter="$filter" \
- | while read -r dnsName name; do
+ --filter="$filter" |
+ while read -r dnsName name; do
printf "%s\t%s\t%s\n" "$(echo "$name" | awk -F"." '{print NF-1}')" "$dnsName" "$name"
- done \
- | sort -n -r | _head_n 1 | cut -f2,3 | grep '^.*'); then
+ done |
+ sort -n -r | _head_n 1 | cut -f2,3 | grep '^.*'); then
_err "_dns_gcloud_find_zone: Can't find a matching managed zone! Perhaps wrong project or gcloud credentials?"
return 1
fi
diff --git a/dnsapi/dns_he.sh b/dnsapi/dns_he.sh
index 5829e00e..ef09fa0a 100755
--- a/dnsapi/dns_he.sh
+++ b/dnsapi/dns_he.sh
@@ -101,8 +101,8 @@ dns_he_rm() {
body="$body&hosted_dns_editzone=1"
body="$body&hosted_dns_delrecord=1"
body="$body&hosted_dns_delconfirm=delete"
- _post "$body" "https://dns.he.net/" \
- | grep 'Successfully removed record.
' \
+ _post "$body" "https://dns.he.net/" |
+ grep 'Successfully removed record.
' \
>/dev/null
exit_code="$?"
if [ "$exit_code" -eq 0 ]; then
diff --git a/dnsapi/dns_hetzner.sh b/dnsapi/dns_hetzner.sh
index 5db0418c..911d4a35 100644
--- a/dnsapi/dns_hetzner.sh
+++ b/dnsapi/dns_hetzner.sh
@@ -123,10 +123,10 @@ _find_record() {
return 1
else
_record_id=$(
- echo "$response" \
- | grep -o "{[^\{\}]*\"name\":\"$_record_name\"[^\}]*}" \
- | grep "\"value\":\"$_record_value\"" \
- | while read -r record; do
+ echo "$response" |
+ grep -o "{[^\{\}]*\"name\":\"$_record_name\"[^\}]*}" |
+ grep "\"value\":\"$_record_value\"" |
+ while read -r record; do
# test for type and
if [ -n "$(echo "$record" | _egrep_o '"type":"TXT"')" ]; then
echo "$record" | _egrep_o '"id":"[^"]*"' | cut -d : -f 2 | tr -d \"
diff --git a/dnsapi/dns_ispconfig.sh b/dnsapi/dns_ispconfig.sh
index 2d8d6b0a..bd1e0391 100755
--- a/dnsapi/dns_ispconfig.sh
+++ b/dnsapi/dns_ispconfig.sh
@@ -95,29 +95,29 @@ _ISPC_getZoneInfo() {
server_id=$(echo "${curResult}" | _egrep_o "server_id.*" | cut -d ':' -f 2 | cut -d '"' -f 2)
_debug "Server ID: '${server_id}'"
case "${server_id}" in
- '' | *[!0-9]*)
- _err "Server ID is not numeric."
- return 1
- ;;
- *) _info "Retrieved Server ID" ;;
+ '' | *[!0-9]*)
+ _err "Server ID is not numeric."
+ return 1
+ ;;
+ *) _info "Retrieved Server ID" ;;
esac
zone=$(echo "${curResult}" | _egrep_o "\"id.*" | cut -d ':' -f 2 | cut -d '"' -f 2)
_debug "Zone: '${zone}'"
case "${zone}" in
- '' | *[!0-9]*)
- _err "Zone ID is not numeric."
- return 1
- ;;
- *) _info "Retrieved Zone ID" ;;
+ '' | *[!0-9]*)
+ _err "Zone ID is not numeric."
+ return 1
+ ;;
+ *) _info "Retrieved Zone ID" ;;
esac
client_id=$(echo "${curResult}" | _egrep_o "sys_userid.*" | cut -d ':' -f 2 | cut -d '"' -f 2)
_debug "Client ID: '${client_id}'"
case "${client_id}" in
- '' | *[!0-9]*)
- _err "Client ID is not numeric."
- return 1
- ;;
- *) _info "Retrieved Client ID." ;;
+ '' | *[!0-9]*)
+ _err "Client ID is not numeric."
+ return 1
+ ;;
+ *) _info "Retrieved Client ID." ;;
esac
zoneFound=""
zoneEnd=""
@@ -135,11 +135,11 @@ _ISPC_addTxt() {
record_id=$(echo "${curResult}" | _egrep_o "\"response.*" | cut -d ':' -f 2 | cut -d '"' -f 2)
_debug "Record ID: '${record_id}'"
case "${record_id}" in
- '' | *[!0-9]*)
- _err "Couldn't add ACME Challenge TXT record to zone."
- return 1
- ;;
- *) _info "Added ACME Challenge TXT record to zone." ;;
+ '' | *[!0-9]*)
+ _err "Couldn't add ACME Challenge TXT record to zone."
+ return 1
+ ;;
+ *) _info "Added ACME Challenge TXT record to zone." ;;
esac
}
@@ -153,24 +153,24 @@ _ISPC_rmTxt() {
record_id=$(echo "${curResult}" | _egrep_o "\"id.*" | cut -d ':' -f 2 | cut -d '"' -f 2)
_debug "Record ID: '${record_id}'"
case "${record_id}" in
- '' | *[!0-9]*)
- _err "Record ID is not numeric."
+ '' | *[!0-9]*)
+ _err "Record ID is not numeric."
+ return 1
+ ;;
+ *)
+ unset IFS
+ _info "Retrieved Record ID."
+ curData="{\"session_id\":\"${sessionID}\",\"primary_id\":\"${record_id}\",\"update_serial\":true}"
+ curResult="$(_post "${curData}" "${ISPC_Api}?dns_txt_delete")"
+ _debug "Calling _ISPC_rmTxt: '${curData}' '${ISPC_Api}?dns_txt_delete'"
+ _debug "Result of _ISPC_rmTxt: '$curResult'"
+ if _contains "${curResult}" '"code":"ok"'; then
+ _info "Removed ACME Challenge TXT record from zone."
+ else
+ _err "Couldn't remove ACME Challenge TXT record from zone."
return 1
- ;;
- *)
- unset IFS
- _info "Retrieved Record ID."
- curData="{\"session_id\":\"${sessionID}\",\"primary_id\":\"${record_id}\",\"update_serial\":true}"
- curResult="$(_post "${curData}" "${ISPC_Api}?dns_txt_delete")"
- _debug "Calling _ISPC_rmTxt: '${curData}' '${ISPC_Api}?dns_txt_delete'"
- _debug "Result of _ISPC_rmTxt: '$curResult'"
- if _contains "${curResult}" '"code":"ok"'; then
- _info "Removed ACME Challenge TXT record from zone."
- else
- _err "Couldn't remove ACME Challenge TXT record from zone."
- return 1
- fi
- ;;
+ fi
+ ;;
esac
fi
}
diff --git a/dnsapi/dns_joker.sh b/dnsapi/dns_joker.sh
index 5d50953e..78399a1d 100644
--- a/dnsapi/dns_joker.sh
+++ b/dnsapi/dns_joker.sh
@@ -100,7 +100,7 @@ _get_root() {
fi
# Try to remove a test record. With correct root domain, username and password this will return "OK: ..." regardless
- # of record in question existing or not.
+ # of record in question existing or not.
if _joker_rest "username=$JOKER_USERNAME&password=$JOKER_PASSWORD&zone=$h&label=jokerTXTUpdateTest&type=TXT&value="; then
if _startswith "$response" "OK"; then
_sub_domain="$(echo "$fulldomain" | sed "s/\\.$h\$//")"
diff --git a/dnsapi/dns_kappernet.sh b/dnsapi/dns_kappernet.sh
index b3481c6c..83a7e5f8 100644
--- a/dnsapi/dns_kappernet.sh
+++ b/dnsapi/dns_kappernet.sh
@@ -5,12 +5,12 @@
# please report issues here: https://github.com/acmesh-official/acme.sh/issues/2977
#KAPPERNETDNS_Key="yourKAPPERNETapikey"
-#KAPPERNETDNS_Secret="yourKAPPERNETapisecret"
+#KAPPERNETDNS_Secret="yourKAPPERNETapisecret"
KAPPERNETDNS_Api="https://dnspanel.kapper.net/API/1.2?APIKey=$KAPPERNETDNS_Key&APISecret=$KAPPERNETDNS_Secret"
###############################################################################
-# called with
+# called with
# fullhostname: something.example.com
# txtvalue: someacmegenerated string
dns_kappernet_add() {
@@ -97,7 +97,7 @@ dns_kappernet_rm() {
#################### Private functions below ##################################
# called with hostname
# e.g._acme-challenge.www.domain.com returns
-# _sub_domain=_acme-challenge.www
+# _sub_domain=_acme-challenge.www
# _domain=domain.com
_get_root() {
domain=$1
@@ -127,7 +127,7 @@ _get_root() {
################################################################################
# calls the kapper.net DNS Panel API
-# with
+# with
# method
# param
_kappernet_api() {
diff --git a/dnsapi/dns_netlify.sh b/dnsapi/dns_netlify.sh
index 137ac1fb..2ce13e2b 100644
--- a/dnsapi/dns_netlify.sh
+++ b/dnsapi/dns_netlify.sh
@@ -144,7 +144,7 @@ _netlify_rest() {
export _H1="Content-Type: application/json"
export _H2="Authorization: Bearer $token_trimmed"
- :>"$HTTP_HEADER"
+ : >"$HTTP_HEADER"
if [ "$m" != "GET" ]; then
_debug data "$data"
diff --git a/dnsapi/dns_one.sh b/dnsapi/dns_one.sh
index 96ef5969..890cc804 100644
--- a/dnsapi/dns_one.sh
+++ b/dnsapi/dns_one.sh
@@ -6,10 +6,10 @@
# Created: 2019-02-17
# Fixed by: @der-berni
# Modified: 2020-04-07
-#
+#
# Use ONECOM_KeepCnameProxy to keep the CNAME DNS record
# export ONECOM_KeepCnameProxy="1"
-#
+#
# export ONECOM_User="username"
# export ONECOM_Password="password"
#
diff --git a/dnsapi/dns_ovh.sh b/dnsapi/dns_ovh.sh
index 7c18d009..dda47dda 100755
--- a/dnsapi/dns_ovh.sh
+++ b/dnsapi/dns_ovh.sh
@@ -41,40 +41,40 @@ _ovh_get_api() {
case "${_ogaep}" in
- ovh-eu | ovheu)
- printf "%s" $OVH_EU
- return
- ;;
- ovh-ca | ovhca)
- printf "%s" $OVH_CA
- return
- ;;
- kimsufi-eu | kimsufieu)
- printf "%s" $KSF_EU
- return
- ;;
- kimsufi-ca | kimsufica)
- printf "%s" $KSF_CA
- return
- ;;
- soyoustart-eu | soyoustarteu)
- printf "%s" $SYS_EU
- return
- ;;
- soyoustart-ca | soyoustartca)
- printf "%s" $SYS_CA
- return
- ;;
- runabove-ca | runaboveca)
- printf "%s" $RAV_CA
- return
- ;;
+ ovh-eu | ovheu)
+ printf "%s" $OVH_EU
+ return
+ ;;
+ ovh-ca | ovhca)
+ printf "%s" $OVH_CA
+ return
+ ;;
+ kimsufi-eu | kimsufieu)
+ printf "%s" $KSF_EU
+ return
+ ;;
+ kimsufi-ca | kimsufica)
+ printf "%s" $KSF_CA
+ return
+ ;;
+ soyoustart-eu | soyoustarteu)
+ printf "%s" $SYS_EU
+ return
+ ;;
+ soyoustart-ca | soyoustartca)
+ printf "%s" $SYS_CA
+ return
+ ;;
+ runabove-ca | runaboveca)
+ printf "%s" $RAV_CA
+ return
+ ;;
- *)
+ *)
- _err "Unknown parameter : $1"
- return 1
- ;;
+ _err "Unknown parameter : $1"
+ return 1
+ ;;
esac
}
diff --git a/dnsapi/dns_pleskxml.sh b/dnsapi/dns_pleskxml.sh
index fe18bef4..f5986827 100644
--- a/dnsapi/dns_pleskxml.sh
+++ b/dnsapi/dns_pleskxml.sh
@@ -136,11 +136,12 @@ dns_pleskxml_rm() {
# Reduce output to one line per DNS record, filtered for TXT records with a record ID only (which they should all have)
# Also strip out spaces between tags, redundant and group tags and any tags
- reclist="$(_api_response_split "$pleskxml_prettyprint_result" 'result' 'ok' \
- | sed 's# \{1,\}<\([a-zA-Z]\)#<\1#g;s#\{0,1\}data>##g;s#<[a-z][^/<>]*/>##g' \
- | grep "${root_domain_id}" \
- | grep '[0-9]\{1,\}' \
- | grep 'TXT'
+ reclist="$(
+ _api_response_split "$pleskxml_prettyprint_result" 'result' 'ok' |
+ sed 's# \{1,\}<\([a-zA-Z]\)#<\1#g;s#\{0,1\}data>##g;s#<[a-z][^/<>]*/>##g' |
+ grep "${root_domain_id}" |
+ grep '[0-9]\{1,\}' |
+ grep 'TXT'
)"
if [ -z "$reclist" ]; then
@@ -151,10 +152,11 @@ dns_pleskxml_rm() {
_debug "Got list of DNS TXT records for root domain '$root_domain_name':"
_debug "$reclist"
- recid="$(_value "$reclist" \
- | grep "${fulldomain}." \
- | grep "${txtvalue}" \
- | sed 's/^.*\([0-9]\{1,\}\)<\/id>.*$/\1/'
+ recid="$(
+ _value "$reclist" |
+ grep "${fulldomain}." |
+ grep "${txtvalue}" |
+ sed 's/^.*\([0-9]\{1,\}\)<\/id>.*$/\1/'
)"
if ! _value "$recid" | grep '^[0-9]\{1,\}$' >/dev/null; then
@@ -220,11 +222,11 @@ _countdots() {
# Last line could change to instead, with suitable escaping of ['"/$],
# if future Plesk XML API changes ever require extended regex
_api_response_split() {
- printf '%s' "$1" \
- | sed 's/^ +//;s/ +$//' \
- | tr -d '\n\r' \
- | sed "s/<\/\{0,1\}$2>/${NEWLINE}/g" \
- | grep "$3"
+ printf '%s' "$1" |
+ sed 's/^ +//;s/ +$//' |
+ tr -d '\n\r' |
+ sed "s/<\/\{0,1\}$2>/${NEWLINE}/g" |
+ grep "$3"
}
#################### Private functions below (DNS functions) ##################################
@@ -261,14 +263,15 @@ _call_api() {
elif [ "$statuslines_count_okay" -ne "$statuslines_count_total" ]; then
# We have some status lines that aren't "ok". Any available details are in API response fields "status" "errcode" and "errtext"
- # Workaround for basic regex:
+ # Workaround for basic regex:
# - filter output to keep only lines like this: "SPACEStextSPACES" (shouldn't be necessary with prettyprint but guarantees subsequent code is ok)
# - then edit the 3 "useful" error tokens individually and remove closing tags on all lines
# - then filter again to remove all lines not edited (which will be the lines not starting A-Z)
- errtext="$(_value "$pleskxml_prettyprint_result" \
- | grep '^ *<[a-z]\{1,\}>[^<]*<\/[a-z]\{1,\}> *$' \
- | sed 's/^ */Status: /;s/^ */Error code: /;s/^ */Error text: /;s/<\/.*$//' \
- | grep '^[A-Z]'
+ errtext="$(
+ _value "$pleskxml_prettyprint_result" |
+ grep '^ *<[a-z]\{1,\}>[^<]*<\/[a-z]\{1,\}> *$' |
+ sed 's/^ */Status: /;s/^ */Error code: /;s/^ */Error text: /;s/<\/.*$//' |
+ grep '^[A-Z]'
)"
fi
diff --git a/dnsapi/dns_regru.sh b/dnsapi/dns_regru.sh
index b5729fda..a50821eb 100644
--- a/dnsapi/dns_regru.sh
+++ b/dnsapi/dns_regru.sh
@@ -87,11 +87,11 @@ _get_root() {
for ITEM in ${domains_list}; do
case "${domain}" in
- *${ITEM}*)
- _domain=${ITEM}
- _debug _domain "${_domain}"
- return 0
- ;;
+ *${ITEM}*)
+ _domain=${ITEM}
+ _debug _domain "${_domain}"
+ return 0
+ ;;
esac
done
diff --git a/notify/mail.sh b/notify/mail.sh
index 54b2a6d4..d33fd0d2 100644
--- a/notify/mail.sh
+++ b/notify/mail.sh
@@ -98,24 +98,24 @@ _mail_cmnd() {
_MAIL_ARGS=""
case $(basename "$_MAIL_BIN") in
- sendmail)
- if [ -n "$MAIL_FROM" ]; then
- _MAIL_ARGS="-f '$MAIL_FROM'"
- fi
- ;;
- mutt | mail)
- _MAIL_ARGS="-s '$_subject'"
- ;;
- msmtp)
- if [ -n "$MAIL_FROM" ]; then
- _MAIL_ARGS="-f '$MAIL_FROM'"
- fi
+ sendmail)
+ if [ -n "$MAIL_FROM" ]; then
+ _MAIL_ARGS="-f '$MAIL_FROM'"
+ fi
+ ;;
+ mutt | mail)
+ _MAIL_ARGS="-s '$_subject'"
+ ;;
+ msmtp)
+ if [ -n "$MAIL_FROM" ]; then
+ _MAIL_ARGS="-f '$MAIL_FROM'"
+ fi
- if [ -n "$MAIL_MSMTP_ACCOUNT" ]; then
- _MAIL_ARGS="$_MAIL_ARGS -a '$MAIL_MSMTP_ACCOUNT'"
- fi
- ;;
- *) ;;
+ if [ -n "$MAIL_MSMTP_ACCOUNT" ]; then
+ _MAIL_ARGS="$_MAIL_ARGS -a '$MAIL_MSMTP_ACCOUNT'"
+ fi
+ ;;
+ *) ;;
esac
echo "'$_MAIL_BIN' $_MAIL_ARGS '$MAIL_TO'"
@@ -123,16 +123,16 @@ _mail_cmnd() {
_mail_body() {
case $(basename "$_MAIL_BIN") in
- sendmail | ssmtp | msmtp)
- if [ -n "$MAIL_FROM" ]; then
- echo "From: $MAIL_FROM"
- fi
+ sendmail | ssmtp | msmtp)
+ if [ -n "$MAIL_FROM" ]; then
+ echo "From: $MAIL_FROM"
+ fi
- echo "To: $MAIL_TO"
- echo "Subject: $subject"
- echo "Content-Type: $contenttype"
- echo
- ;;
+ echo "To: $MAIL_TO"
+ echo "Subject: $subject"
+ echo "Content-Type: $contenttype"
+ echo
+ ;;
esac
echo "$_content"
diff --git a/notify/teams.sh b/notify/teams.sh
index e50ea703..1bc5ed08 100644
--- a/notify/teams.sh
+++ b/notify/teams.sh
@@ -52,15 +52,15 @@ teams_send() {
_content=$(echo "$_content" | _json_encode)
case "$_statusCode" in
- 0)
- _color="${TEAMS_SUCCESS_COLOR:-$_color_success}"
- ;;
- 1)
- _color="${TEAMS_ERROR_COLOR:-$_color_danger}"
- ;;
- 2)
- _color="${TEAMS_SKIP_COLOR:-$_color_muted}"
- ;;
+ 0)
+ _color="${TEAMS_SUCCESS_COLOR:-$_color_success}"
+ ;;
+ 1)
+ _color="${TEAMS_ERROR_COLOR:-$_color_danger}"
+ ;;
+ 2)
+ _color="${TEAMS_SKIP_COLOR:-$_color_muted}"
+ ;;
esac
_color=$(echo "$_color" | tr -cd 'a-fA-F0-9')
diff --git a/notify/xmpp.sh b/notify/xmpp.sh
index 580f471e..0ce1119e 100644
--- a/notify/xmpp.sh
+++ b/notify/xmpp.sh
@@ -71,13 +71,13 @@ _xmpp_bin() {
_xmpp_cmnd() {
case $(basename "$_XMPP_BIN") in
- sendxmpp)
- echo "'$_XMPP_BIN' '$XMPP_TO' $XMPP_BIN_ARGS"
- ;;
- *)
- _err "Command $XMPP_BIN is not supported, use sendxmpp."
- return 1
- ;;
+ sendxmpp)
+ echo "'$_XMPP_BIN' '$XMPP_TO' $XMPP_BIN_ARGS"
+ ;;
+ *)
+ _err "Command $XMPP_BIN is not supported, use sendxmpp."
+ return 1
+ ;;
esac
}