Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
60315e5b
Commit
60315e5b
authored
Nov 23, 2022
by
neil
Browse files
fix shellcheck warnings
parent
cdb238e4
Changes
6
Show whitespace changes
Inline
Side-by-side
deploy/gitlab.sh
View file @
60315e5b
...
...
@@ -67,7 +67,7 @@ gitlab_deploy() {
error_response
=
"error"
if
test
"
${
_response
#*
$error_response
}
"
!=
"
$_response
"
;
then
if
test
${
_response
#*
"
$error_response
"
}
!=
"
$_response
"
;
then
_err
"Error in deploying certificate:"
_err
"
$_response
"
return
1
...
...
dnsapi/dns_dynv6.sh
View file @
60315e5b
...
...
@@ -94,8 +94,8 @@ _get_domain() {
_your_hosts
=
"
$(
echo
"
$_your_hosts
"
|
awk
'/\./ {print $1}'
)
"
for
l
in
$_your_hosts
;
do
#echo "host: $l"
if
test
"
${
_full_domain
#*
$l
}
"
!=
"
$_full_domain
"
;
then
_record
=
"
${
_full_domain
%.
$l
}
"
if
test
${
_full_domain
#*
"
$l
"
}
!=
"
$_full_domain
"
;
then
_record
=
${
_full_domain
%.
"
$l
"
}
_host
=
$l
_debug
"The host is
$_host
and the record
$_record
"
return
0
...
...
@@ -143,7 +143,7 @@ _dns_dynv6_add_http() {
return
1
fi
_get_zone_name
"
$_zone_id
"
record
=
"
${
fulldomain
%%.
$_zone_name
}
"
record
=
${
fulldomain
%%.
"
$_zone_name
"
}
_set_record TXT
"
$record
"
"
$txtvalue
"
if
_contains
"
$response
"
"
$txtvalue
"
;
then
_info
"Successfully added record"
...
...
@@ -161,7 +161,7 @@ _dns_dynv6_rm_http() {
return
1
fi
_get_zone_name
"
$_zone_id
"
record
=
"
${
fulldomain
%%.
$_zone_name
}
"
record
=
${
fulldomain
%%.
"
$_zone_name
"
}
_get_record_id
"
$_zone_id
"
"
$record
"
"
$txtvalue
"
_del_record
"
$_zone_id
"
"
$_record_id
"
if
[
-z
"
$response
"
]
;
then
...
...
dnsapi/dns_edgedns.sh
View file @
60315e5b
...
...
@@ -418,7 +418,7 @@ _edgedns_make_data_to_sign() {
_secure_debug2
"hdr"
"
$hdr
"
_edgedns_make_content_hash
path
=
"
$(
echo
"
$_request_url_path
"
|
tr
-d
"
\n\r
"
|
sed
's/https\?:\/\///'
)
"
path
=
"
${
path
#*
$AKAMAI_HOST
}
"
path
=
${
path
#*
"
$AKAMAI_HOST
"
}
_debug
"hier path"
"
$path
"
# dont expose headers to sign so use MT string
_mdata
=
"
$(
printf
"%s
\t
https
\t
%s
\t
%s
\t
%s
\t
%s
\t
%s"
"
$_request_method
"
"
$AKAMAI_HOST
"
"
$path
"
""
"
$_hash
"
"
$hdr
"
)
"
...
...
dnsapi/dns_infomaniak.sh
View file @
60315e5b
...
...
@@ -76,7 +76,7 @@ dns_infomaniak_add() {
domain_id
=
${
zone_and_id
#*
}
# extract first part of domain
key
=
${
fulldomain
%.
$zone
}
key
=
${
fulldomain
%.
"
$zone
"
}
_debug
"zone:
$zone
id:
$domain_id
key:
$key
"
...
...
@@ -149,7 +149,7 @@ dns_infomaniak_rm() {
domain_id
=
${
zone_and_id
#*
}
# extract first part of domain
key
=
${
fulldomain
%.
$zone
}
key
=
${
fulldomain
%.
"
$zone
"
}
_debug
"zone:
$zone
id:
$domain_id
key:
$key
"
...
...
dnsapi/dns_servercow.sh
View file @
60315e5b
...
...
@@ -53,7 +53,7 @@ dns_servercow_add() {
if
printf
--
"%s"
"
$response
"
|
grep
"{
\"
name
\"
:
\"
$_sub_domain
\"
,
\"
ttl
\"
:20,
\"
type
\"
:
\"
TXT
\"
"
>
/dev/null
;
then
_info
"A txt record with the same name already exists."
# trim the string on the left
txtvalue_old
=
${
response
#*{\
"name
\"
:
\"
$_sub_domain
\"
,
\"
ttl
\"
:20,
\"
type
\"
:
\"
TXT
\"
,
\"
content
\"
:
\"
}
txtvalue_old
=
${
response
#*{\
"name
\"
:
\"
"
$_sub_domain
"
\"
,
\"
ttl
\"
:20,
\"
type
\"
:
\"
TXT
\"
,
\"
content
\"
:
\"
}
# trim the string on the right
txtvalue_old=
${
txtvalue_old
%%\
"*}
...
...
dnsapi/dns_vultr.sh
View file @
60315e5b
...
...
@@ -139,7 +139,7 @@ _vultr_rest() {
data
=
"
$3
"
_debug
"
$ep
"
api_key_trimmed
=
$(
echo
$VULTR_API_KEY
|
tr
-d
'"'
)
api_key_trimmed
=
$(
echo
"
$VULTR_API_KEY
"
|
tr
-d
'"'
)
export
_H1
=
"Authorization: Bearer
$api_key_trimmed
"
export
_H2
=
'Content-Type: application/json'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment