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
c3dd3ef0
Commit
c3dd3ef0
authored
Jul 20, 2016
by
neil
Browse files
typos
parent
fa989a55
Changes
1
Show whitespace changes
Inline
Side-by-side
acme.sh
View file @
c3dd3ef0
...
...
@@ -1105,23 +1105,23 @@ _initpath() {
_apachePath() {
_APAHECTL
=
"apachectl"
_APA
C
HECTL="apachectl"
if ! _exists apachectl ; then
if _exists apache2ctl ; then
_APAHECTL
=
"apache2ctl"
_APA
C
HECTL="apache2ctl"
else
_err "'apachectl not found. It seems that apache is not installed, or you are not root user.'"
_err "Please use webroot mode to try again."
return 1
fi
fi
httpdconfname
=
"
$(
$_APAHECTL
-V
|
grep
SERVER_CONFIG_FILE
=
|
cut
-d
=
-f
2 |
tr
-d
'"'
)
"
httpdconfname="$($_APA
C
HECTL -V | grep SERVER_CONFIG_FILE= | cut -d = -f 2 | tr -d '"' )"
_debug httpdconfname "$httpdconfname"
if _startswith "$httpdconfname" '/' ; then
httpdconf="$httpdconfname"
httpdconfname="$(basename $httpdconfname)"
else
httpdroot
=
"
$(
$_APAHECTL
-V
|
grep
HTTPD_ROOT
=
|
cut
-d
=
-f
2 |
tr
-d
'"'
)
"
httpdroot="$($_APA
C
HECTL -V | grep HTTPD_ROOT= | cut -d = -f 2 | tr -d '"' )"
_debug httpdroot "$httpdroot"
httpdconf="$httpdroot/$httpdconfname"
httpdconfname="$(basename $httpdconfname)"
...
...
@@ -1151,7 +1151,7 @@ _restoreApache() {
cat "$APACHE_CONF_BACKUP_DIR/$httpdconfname" > "$httpdconf"
_debug "Restored: $httpdconf."
if
!
$_APAHECTL
-t
>
/dev/null 2>&1
;
then
if ! $_APA
C
HECTL -t >/dev/null 2>&1 ; then
_err "Sorry, restore apache config error, please contact me."
return 1;
fi
...
...
@@ -1168,7 +1168,7 @@ _setApache() {
#test the conf first
_info "Checking if there is an error in the apache config file before starting."
_msg
=
"
$(
$_APAHECTL
-t
2>&1
)
"
_msg="$($_APA
C
HECTL -t 2>&1 )"
if [ "$?" != "0" ] ; then
_err "Sorry, apache config file has error, please fix it first, then try again."
_err "Don't worry, there is nothing changed to your system."
...
...
@@ -1191,7 +1191,7 @@ _setApache() {
#add alias
apacheVer
=
"
$(
$_APAHECTL
-V
|
grep
"Server version:"
|
cut
-d
:
-f
2 |
cut
-d
" "
-f
2 |
cut
-d
'/'
-f
2
)
"
apacheVer="$($_APA
C
HECTL -V | grep "Server version:" | cut -d : -f 2 | cut -d " " -f 2 | cut -d '/' -f 2 )"
_debug "apacheVer" "$apacheVer"
apacheMajer="$(echo "$apacheVer" | cut -d . -f 1)"
apacheMinor="$(echo "$apacheVer" | cut -d . -f 2)"
...
...
@@ -1215,7 +1215,7 @@ Allow from all
" >> "$httpdconf"
fi
_msg
=
"
$(
$_APAHECTL
-t
2>&1
)
"
_msg="$($_APA
C
HECTL -t 2>&1 )"
if [ "$?" != "0" ] ; then
_err "Sorry, apache config error"
if _restoreApache ; then
...
...
@@ -1231,8 +1231,8 @@ Allow from all
chmod 755 "$ACME_DIR"
fi
if
!
$_APAHECTL
graceful
;
then
_err
"Sorry,
$_APAHECTL
graceful error, please contact me."
if ! $_APA
C
HECTL graceful ; then
_err "Sorry, $_APA
C
HECTL graceful error, please contact me."
_restoreApache
return 1;
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