Skip to content

Commit 16dc21a

Browse files
authored
Merge pull request #4406 from acmesh-official/dev
sync
2 parents 43b1a4b + 3a1c6d8 commit 16dc21a

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

.github/workflows/shellcheck.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ jobs:
2222
ShellCheck:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
2626
- name: Install Shellcheck
2727
run: sudo apt-get install -y shellcheck
2828
- name: DoShellcheck
29-
run: shellcheck -V && shellcheck -e SC2181 **/*.sh && echo "shellcheck OK"
29+
run: shellcheck -V && shellcheck -e SC2181 -e SC2089 **/*.sh && echo "shellcheck OK"
3030

3131
shfmt:
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v3
3535
- name: Install shfmt
3636
run: curl -sSL https://github.com/mvdan/sh/releases/download/v3.1.2/shfmt_v3.1.2_linux_amd64 -o ~/shfmt && chmod +x ~/shfmt
3737
- name: shfmt

deploy/gitlab.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ gitlab_deploy() {
6767

6868
error_response="error"
6969

70-
if test "${_response#*$error_response}" != "$_response"; then
70+
if test "${_response#*"$error_response"}" != "$_response"; then
7171
_err "Error in deploying certificate:"
7272
_err "$_response"
7373
return 1

dnsapi/dns_dynv6.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ _get_domain() {
9494
_your_hosts="$(echo "$_your_hosts" | awk '/\./ {print $1}')"
9595
for l in $_your_hosts; do
9696
#echo "host: $l"
97-
if test "${_full_domain#*$l}" != "$_full_domain"; then
98-
_record="${_full_domain%.$l}"
97+
if test "${_full_domain#*"$l"}" != "$_full_domain"; then
98+
_record=${_full_domain%."$l"}
9999
_host=$l
100100
_debug "The host is $_host and the record $_record"
101101
return 0
@@ -143,7 +143,7 @@ _dns_dynv6_add_http() {
143143
return 1
144144
fi
145145
_get_zone_name "$_zone_id"
146-
record="${fulldomain%%.$_zone_name}"
146+
record=${fulldomain%%."$_zone_name"}
147147
_set_record TXT "$record" "$txtvalue"
148148
if _contains "$response" "$txtvalue"; then
149149
_info "Successfully added record"
@@ -161,7 +161,7 @@ _dns_dynv6_rm_http() {
161161
return 1
162162
fi
163163
_get_zone_name "$_zone_id"
164-
record="${fulldomain%%.$_zone_name}"
164+
record=${fulldomain%%."$_zone_name"}
165165
_get_record_id "$_zone_id" "$record" "$txtvalue"
166166
_del_record "$_zone_id" "$_record_id"
167167
if [ -z "$response" ]; then

dnsapi/dns_edgedns.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ _edgedns_make_data_to_sign() {
418418
_secure_debug2 "hdr" "$hdr"
419419
_edgedns_make_content_hash
420420
path="$(echo "$_request_url_path" | tr -d "\n\r" | sed 's/https\?:\/\///')"
421-
path="${path#*$AKAMAI_HOST}"
421+
path=${path#*"$AKAMAI_HOST"}
422422
_debug "hier path" "$path"
423423
# dont expose headers to sign so use MT string
424424
_mdata="$(printf "%s\thttps\t%s\t%s\t%s\t%s\t%s" "$_request_method" "$AKAMAI_HOST" "$path" "" "$_hash" "$hdr")"

dnsapi/dns_infomaniak.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ dns_infomaniak_add() {
7676
domain_id=${zone_and_id#* }
7777

7878
# extract first part of domain
79-
key=${fulldomain%.$zone}
79+
key=${fulldomain%."$zone"}
8080

8181
_debug "zone:$zone id:$domain_id key:$key"
8282

@@ -149,7 +149,7 @@ dns_infomaniak_rm() {
149149
domain_id=${zone_and_id#* }
150150

151151
# extract first part of domain
152-
key=${fulldomain%.$zone}
152+
key=${fulldomain%."$zone"}
153153

154154
_debug "zone:$zone id:$domain_id key:$key"
155155

dnsapi/dns_oci.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ _signed_request() {
265265
_response="$(_get "https://${_sig_host}${_sig_target}")"
266266
elif [ "$_curl_method" = "PATCH" ]; then
267267
export _H1="$_date_header"
268+
# shellcheck disable=SC2090
268269
export _H2="$_sig_body_sha256"
269270
export _H3="$_sig_body_type"
270271
export _H4="$_sig_body_length"

dnsapi/dns_servercow.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ dns_servercow_add() {
5353
if printf -- "%s" "$response" | grep "{\"name\":\"$_sub_domain\",\"ttl\":20,\"type\":\"TXT\"" >/dev/null; then
5454
_info "A txt record with the same name already exists."
5555
# trim the string on the left
56-
txtvalue_old=${response#*{\"name\":\"$_sub_domain\",\"ttl\":20,\"type\":\"TXT\",\"content\":\"}
56+
txtvalue_old=${response#*{\"name\":\""$_sub_domain"\",\"ttl\":20,\"type\":\"TXT\",\"content\":\"}
5757
# trim the string on the right
5858
txtvalue_old=${txtvalue_old%%\"*}
5959

dnsapi/dns_vultr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ _vultr_rest() {
139139
data="$3"
140140
_debug "$ep"
141141

142-
api_key_trimmed=$(echo $VULTR_API_KEY | tr -d '"')
142+
api_key_trimmed=$(echo "$VULTR_API_KEY" | tr -d '"')
143143

144144
export _H1="Authorization: Bearer $api_key_trimmed"
145145
export _H2='Content-Type: application/json'

0 commit comments

Comments
 (0)