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
c53da1ef
Commit
c53da1ef
authored
May 03, 2016
by
neil
Browse files
fix bug. when the webroot contains 'no' or 'apache'
parent
01f54558
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
c53da1ef
...
...
@@ -76,6 +76,29 @@ _contains(){
echo
$_str
|
grep
$_sub
>
/dev/null 2>&1
}
_hasfield
()
{
_str
=
"
$1
"
_field
=
"
$2
"
_sep
=
"
$3
"
if
[
-z
"
$_field
"
]
;
then
_err
"Usage: str field [sep]"
return
1
fi
if
[
-z
"
$_sep
"
]
;
then
_sep
=
","
fi
for
f
in
$(
echo
"
$_str
"
|
tr
','
' '
)
;
do
if
[
"
$f
"
=
"
$_field
"
]
;
then
_debug
"'
$_str
' contains '
$_field
'"
return
0
#contains ok
fi
done
_debug
"'
$_str
' does not contain '
$_field
'"
return
1
#not contains
}
_exists
(){
cmd
=
"
$1
"
if
[
-z
"
$cmd
"
]
;
then
...
...
@@ -1057,7 +1080,7 @@ issue() {
Le_Keylength
=
""
fi
if
_
contains
"
$Le_Webroot
"
"no"
;
then
if
_
hasfield
"
$Le_Webroot
"
"no"
;
then
_info
"Standalone mode."
if
!
_exists
"nc"
;
then
_err
"Please install netcat(nc) tools first."
...
...
@@ -1078,7 +1101,7 @@ issue() {
fi
fi
if
_
contains
"
$Le_Webroot
"
"apache"
;
then
if
_
hasfield
"
$Le_Webroot
"
"apache"
;
then
if
!
_setApache
;
then
_err
"set up apache error. Report error to me."
return
1
...
...
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