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
800e3f45
Commit
800e3f45
authored
Oct 25, 2016
by
neilpang
Browse files
support dns_xxx_rm function
fix
https://github.com/Neilpang/acme.sh/issues/79
parent
35c61f52
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
800e3f45
#!/usr/bin/env sh
VER
=
2.6.
1
VER
=
2.6.
2
PROJECT_NAME
=
"acme.sh"
...
...
@@ -1771,6 +1771,7 @@ _clearup() {
_stopserver
$serverproc
serverproc
=
""
_restoreApache
_clearupdns
if
[
-z
"
$DEBUG
"
]
;
then
rm
-f
"
$TLS_CONF
"
rm
-f
"
$TLS_CERT
"
...
...
@@ -1779,6 +1780,62 @@ _clearup() {
fi
}
_clearupdns
()
{
_debug
"_clearupdns"
if
[
"
$dnsadded
"
!=
1
]
||
[
-z
"
$vlist
"
]
;
then
_info
"Dns not added, skip."
return
fi
ventries
=
$(
echo
"
$vlist
"
|
tr
','
' '
)
for
ventry
in
$ventries
do
d
=
$(
echo
$ventry
|
cut
-d
$sep
-f
1
)
keyauthorization
=
$(
echo
$ventry
|
cut
-d
$sep
-f
2
)
vtype
=
$(
echo
$ventry
|
cut
-d
$sep
-f
4
)
_currentRoot
=
$(
echo
$ventry
|
cut
-d
$sep
-f
5
)
if
[
"
$keyauthorization
"
=
"
$STATE_VERIFIED
"
]
;
then
_info
"
$d
is already verified, skip
$vtype
."
continue
fi
if
[
"
$vtype
"
!=
"
$VTYPE_DNS
"
]
;
then
_info
"Skip
$d
for
$vtype
"
continue
fi
d_api
=
"
$(
_findHook
$d
dnsapi
$_currentRoot
)
"
_debug d_api
"
$d_api
"
if
[
-z
"
$d_api
"
]
;
then
_info
"Not Found domain api file:
$d_api
"
continue
fi
(
if
!
.
$d_api
;
then
_err
"Load file
$d_api
error. Please check your api file and try again."
return
1
fi
rmcommand
=
"
${
_currentRoot
}
_rm"
if
!
_exists
$rmcommand
;
then
_err
"It seems that your api file doesn't define
$rmcommand
"
return
1
fi
txtdomain
=
"_acme-challenge.
$d
"
if
!
$rmcommand
$txtdomain
;
then
_err
"Error removing txt for domain:
$txtdomain
"
return
1
fi
)
done
}
# webroot removelevel tokenfile
_clearupwebbroot
()
{
__webroot
=
"
$1
"
...
...
@@ -2037,7 +2094,7 @@ _regAccount() {
if
[
"
$code
"
=
'202'
]
;
then
_info
"Update success."
else
_err
"Update error."
_err
"Update
account
error."
return
1
fi
fi
...
...
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