Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
cecc53fe
Unverified
Commit
cecc53fe
authored
Apr 29, 2020
by
neil
Committed by
GitHub
Apr 29, 2020
Browse files
Merge pull request #2892 from acmesh-official/dev
sync
parents
65c59c8c
58c2c701
Changes
4
Show whitespace changes
Inline
Side-by-side
acme.sh
View file @
cecc53fe
...
...
@@ -1174,9 +1174,8 @@ _createcsr() {
_info
"Multi domain"
"
$alt
"
printf
--
"
\n
subjectAltName=
$alt
"
>>
"
$csrconf
"
fi
if
[
"
$Le_OCSP_Staple
"
]
||
[
"
$Le_OCSP_Stable
"
]
;
then
if
[
"
$Le_OCSP_Staple
"
=
"1
"
]
;
then
_savedomainconf Le_OCSP_Staple
"
$Le_OCSP_Staple
"
_cleardomainconf Le_OCSP_Stable
printf
--
"
\n
basicConstraints = CA:FALSE
\n
1.3.6.1.5.5.7.1.24=DER:30:03:02:01:05"
>>
"
$csrconf
"
fi
...
...
dnsapi/dns_cf.sh
View file @
cecc53fe
...
...
@@ -59,7 +59,7 @@ dns_cf_add() {
_debug
"Getting txt records"
_cf_rest GET
"zones/
${
_domain_id
}
/dns_records?type=TXT&name=
$fulldomain
"
if
!
printf
"%s"
"
$response
"
|
grep
\"
success
\"
:true
>
/dev/null
;
then
if
!
echo
"
$response
"
|
tr
-d
"
"
|
grep
\"
success
\"
:true
>
/dev/null
;
then
_err
"Error"
return
1
fi
...
...
@@ -110,17 +110,17 @@ dns_cf_rm() {
_debug
"Getting txt records"
_cf_rest GET
"zones/
${
_domain_id
}
/dns_records?type=TXT&name=
$fulldomain
&content=
$txtvalue
"
if
!
printf
"%s"
"
$response
"
|
grep
\"
success
\"
:true
>
/dev/null
;
then
if
!
echo
"
$response
"
|
tr
-d
"
"
|
grep
\"
success
\"
:true
>
/dev/null
;
then
_err
"Error:
$response
"
return
1
fi
count
=
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
count
\"
:[^,]*"
|
cut
-d
:
-f
2
)
count
=
$(
echo
"
$response
"
| _egrep_o
"
\"
count
\"
:
*
[^,]*"
|
cut
-d
:
-f
2
|
tr
-d
" "
)
_debug count
"
$count
"
if
[
"
$count
"
=
"0"
]
;
then
_info
"Don't need to remove."
else
record_id
=
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
id
\"
:
\"
[^
\"
]*
\"
"
|
cut
-d
:
-f
2 |
tr
-d
\"
|
head
-
n
1
)
record_id
=
$(
echo
"
$response
"
| _egrep_o
"
\"
id
\"
:
*
\"
[^
\"
]*
\"
"
|
cut
-d
:
-f
2 |
tr
-d
\"
|
_
head
_
n 1
|
tr
-d
" "
)
_debug
"record_id"
"
$record_id
"
if
[
-z
"
$record_id
"
]
;
then
_err
"Can not get record id to remove."
...
...
@@ -130,7 +130,7 @@ dns_cf_rm() {
_err
"Delete record error."
return
1
fi
_contains
"
$response
"
'
"success":true
'
echo
"
$response
"
|
tr
-d
" "
|
grep
\
"
success
\
"
:true
>
/dev/null
fi
}
...
...
@@ -151,8 +151,8 @@ _get_root() {
if
!
_cf_rest GET
"zones/
$CF_Zone_ID
"
;
then
return
1
else
if
_contains
"
$response
"
'
"success":true
'
;
then
_domain
=
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
name
\"
:
\"
[^
\"
]*
\"
"
|
cut
-d
:
-f
2 |
tr
-d
\"
|
head
-
n
1
)
if
echo
"
$response
"
|
tr
-d
" "
|
grep
\
"
success
\
"
:true
>
/dev/null
;
then
_domain
=
$(
echo
"
$response
"
| _egrep_o
"
\"
name
\"
:
*
\"
[^
\"
]*
\"
"
|
cut
-d
:
-f
2 |
tr
-d
\"
|
_
head
_
n 1
|
tr
-d
" "
)
if
[
"
$_domain
"
]
;
then
_cutlength
=
$((${#
domain
}
-
${#
_domain
}
-
1
))
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-c
"1-
$_cutlength
"
)
...
...
@@ -186,7 +186,7 @@ _get_root() {
fi
if
_contains
"
$response
"
"
\"
name
\"
:
\"
$h
\"
"
||
_contains
"
$response
"
'"total_count":1'
;
then
_domain_id
=
$(
echo
"
$response
"
| _egrep_o
"
\[
.
\"
id
\"
:
\"
[^
\"
]*
\"
"
| _head_n 1 |
cut
-d
:
-f
2 |
tr
-d
\"
)
_domain_id
=
$(
echo
"
$response
"
| _egrep_o
"
\[
.
\"
id
\"
:
*
\"
[^
\"
]*
\"
"
| _head_n 1 |
cut
-d
:
-f
2 |
tr
-d
\"
|
tr
-d
" "
)
if
[
"
$_domain_id
"
]
;
then
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_domain
=
$h
...
...
dnsapi/dns_loopia.sh
View file @
cecc53fe
...
...
@@ -217,7 +217,7 @@ _loopia_add_record() {
</member>
<member>
<name>ttl</name>
<value><int>
6
0</int></value>
<value><int>
30
0</int></value>
</member>
<member>
<name>rdata</name>
...
...
dnsapi/dns_opnsense.sh
View file @
cecc53fe
...
...
@@ -150,7 +150,7 @@ _get_root() {
return
1
fi
_debug h
"
$h
"
id
=
$(
echo
"
$_domain_response
"
| _egrep_o
"
\"
[^
\"
]*
\"
:{
\"
enabled
\"
:
\"
1
\"
,
\"
type
\"
:{
\"
master
\"
:{
\"
value
\"
:
\"
master
\"
,
\"
selected
\"
:1},
\"
slave
\"
:{
\"
value
\"
:
\"
slave
\"
,
\"
selected
\"
:0}},
\"
masterip
\"
:
\"
[^
\"
]*
\"
,
\"
allownotifyslave
\"
:{
\"\"
:{[^}]*}},
\"
domainname
\"
:
\"
${
h
}
\"
"
|
cut
-d
':'
-f
1 |
cut
-d
'"'
-f
2
)
id
=
$(
echo
"
$_domain_response
"
| _egrep_o
"
\"
[^
\"
]*
\"
:{
\"
enabled
\"
:
\"
1
\"
,
\"
type
\"
:{
\"
master
\"
:{
\"
value
\"
:
\"
master
\"
,
\"
selected
\"
:1},
\"
slave
\"
:{
\"
value
\"
:
\"
slave
\"
,
\"
selected
\"
:0}},
\"
masterip
\"
:
\"
[^
\"
]*
\"
(
,
\"
allownotifyslave
\"
:{
\"\"
:{[^}]*}},
|,)
\"
domainname
\"
:
\"
${
h
}
\"
"
|
cut
-d
':'
-f
1 |
cut
-d
'"'
-f
2
)
if
[
-n
"
$id
"
]
;
then
_debug
id
"
$id
"
...
...
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