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
5ef501c5
Commit
5ef501c5
authored
Apr 16, 2016
by
neil
Browse files
More. restore apache on error
parent
06625071
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
5ef501c5
...
...
@@ -818,10 +818,12 @@ _restoreApache() {
fi
cp
-p
"
$APACHE_CONF_BACKUP_DIR
/
$httpdconfname
"
"
$httpdconf
"
_debug
"Restored:
$httpdconf
."
if
!
apachectl
-t
;
then
_err
"Sorry, restore apache config error, please contact me."
return
1
;
fi
_debug
"Restored successfully."
rm
-f
"
$APACHE_CONF_BACKUP_DIR
/
$httpdconfname
"
return
0
}
...
...
@@ -886,7 +888,7 @@ Allow from all
return
0
}
_clearup
()
{
_clearup
()
{
_stopserver
$serverproc
serverproc
=
""
_restoreApache
...
...
@@ -977,7 +979,7 @@ issue() {
if
[[
"
$Le_Webroot
"
==
*
"no"
*
]]
;
then
_info
"Standalone mode."
if
!
command
-v
"nc"
>
/dev/null
;
then
if
!
_exists
"nc"
;
then
_err
"Please install netcat(nc) tools first."
return
1
fi
...
...
@@ -1009,11 +1011,17 @@ issue() {
if
[[
!
-f
"
$ACCOUNT_KEY_PATH
"
]]
;
then
if
!
createAccountKey
$Le_Domain
$Le_Keylength
;
then
_err
"Create account key error."
if
[[
"
$usingApache
"
]]
;
then
_restoreApache
fi
return
1
fi
fi
if
!
_calcjwk
"
$ACCOUNT_KEY_PATH
"
;
then
if
[[
"
$usingApache
"
]]
;
then
_restoreApache
fi
return
1
fi
...
...
@@ -1049,12 +1057,14 @@ issue() {
if
[[
!
-f
"
$CERT_KEY_PATH
"
]]
;
then
if
!
createDomainKey
$Le_Domain
$Le_Keylength
;
then
_err
"Create domain key error."
_clearup
return
1
fi
fi
if
!
createCSR
$Le_Domain
$Le_Alt
;
then
_err
"Create CSR error."
_clearup
return
1
fi
...
...
@@ -1171,6 +1181,7 @@ issue() {
)
if
[[
"
$?
"
!=
"0"
]]
;
then
_clearup
return
1
fi
dnsadded
=
'1'
...
...
@@ -1181,6 +1192,7 @@ issue() {
_setopt
"
$DOMAIN_CONF
"
"Le_Vlist"
"="
"
\"
$vlist
\"
"
_debug
"Dns record not added yet, so, save to
$DOMAIN_CONF
and exit."
_err
"Please add the TXT records to the domains, and retry again."
_clearup
return
1
fi
...
...
@@ -1216,6 +1228,7 @@ issue() {
_info
"Standalone mode server"
_startserver
"
$keyauthorization
"
&
if
[[
"
$?
"
!=
"0"
]]
;
then
_clearup
return
1
fi
serverproc
=
"
$!
"
...
...
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