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
327e2fb0
Commit
327e2fb0
authored
Jun 09, 2023
by
neil
Browse files
remove all exec.
https://github.com/acmesh-official/acme.sh/issues/4659
parent
4c302507
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
327e2fb0
...
@@ -2936,22 +2936,6 @@ _initpath() {
...
@@ -2936,22 +2936,6 @@ _initpath() {
}
}
_exec
()
{
if
[
-z
"
$_EXEC_TEMP_ERR
"
]
;
then
_EXEC_TEMP_ERR
=
"
$(
_mktemp
)
"
fi
if
[
"
$_EXEC_TEMP_ERR
"
]
;
then
eval
"
$@
2>>
$_EXEC_TEMP_ERR
"
else
eval
"
$@
"
fi
}
_exec_err
()
{
[
"
$_EXEC_TEMP_ERR
"
]
&&
_err
"
$(
cat
"
$_EXEC_TEMP_ERR
"
)
"
&&
echo
""
>
"
$_EXEC_TEMP_ERR
"
}
_apachePath
()
{
_apachePath
()
{
_APACHECTL
=
"apachectl"
_APACHECTL
=
"apachectl"
if
!
_exists apachectl
;
then
if
!
_exists apachectl
;
then
...
@@ -2964,8 +2948,7 @@ _apachePath() {
...
@@ -2964,8 +2948,7 @@ _apachePath() {
fi
fi
fi
fi
if
!
_exec
$_APACHECTL
-V
>
/dev/null
;
then
if
!
$_APACHECTL
-V
>
/dev/null
;
then
_exec_err
return
1
return
1
fi
fi
...
@@ -3017,8 +3000,7 @@ _restoreApache() {
...
@@ -3017,8 +3000,7 @@ _restoreApache() {
cat
"
$APACHE_CONF_BACKUP_DIR
/
$httpdconfname
"
>
"
$httpdconf
"
cat
"
$APACHE_CONF_BACKUP_DIR
/
$httpdconfname
"
>
"
$httpdconf
"
_debug
"Restored:
$httpdconf
."
_debug
"Restored:
$httpdconf
."
if
!
_exec
$_APACHECTL
-t
;
then
if
!
$_APACHECTL
-t
;
then
_exec_err
_err
"Sorry, restore apache config error, please contact me."
_err
"Sorry, restore apache config error, please contact me."
return
1
return
1
fi
fi
...
@@ -3036,8 +3018,7 @@ _setApache() {
...
@@ -3036,8 +3018,7 @@ _setApache() {
#test the conf first
#test the conf first
_info
"Checking if there is an error in the apache config file before starting."
_info
"Checking if there is an error in the apache config file before starting."
if
!
_exec
"
$_APACHECTL
"
-t
>
/dev/null
;
then
if
!
$_APACHECTL
-t
>
/dev/null
;
then
_exec_err
_err
"The apache config file has error, please fix it first, then try again."
_err
"The apache config file has error, please fix it first, then try again."
_err
"Don't worry, there is nothing changed to your system."
_err
"Don't worry, there is nothing changed to your system."
return
1
return
1
...
@@ -3098,8 +3079,7 @@ Allow from all
...
@@ -3098,8 +3079,7 @@ Allow from all
chmod
755
"
$ACME_DIR
"
chmod
755
"
$ACME_DIR
"
fi
fi
if
!
_exec
"
$_APACHECTL
"
graceful
;
then
if
!
$_APACHECTL
graceful
;
then
_exec_err
_err
"
$_APACHECTL
graceful error, please contact me."
_err
"
$_APACHECTL
graceful error, please contact me."
_restoreApache
_restoreApache
return
1
return
1
...
@@ -3184,8 +3164,7 @@ _setNginx() {
...
@@ -3184,8 +3164,7 @@ _setNginx() {
return
1
return
1
fi
fi
_info
"Check the nginx conf before setting up."
_info
"Check the nginx conf before setting up."
if
!
_exec
"nginx -t"
>
/dev/null
;
then
if
!
nginx
-t
>
/dev/null
;
then
_exec_err
return
1
return
1
fi
fi
...
@@ -3212,16 +3191,14 @@ location ~ \"^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)\$\" {
...
@@ -3212,16 +3191,14 @@ location ~ \"^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)\$\" {
fi
fi
_debug3
"Modified config:
$(
cat
$FOUND_REAL_NGINX_CONF
)
"
_debug3
"Modified config:
$(
cat
$FOUND_REAL_NGINX_CONF
)
"
_info
"nginx conf is done, let's check it again."
_info
"nginx conf is done, let's check it again."
if
!
_exec
"nginx -t"
>
/dev/null
;
then
if
!
nginx
-t
>
/dev/null
;
then
_exec_err
_err
"It seems that nginx conf was broken, let's restore."
_err
"It seems that nginx conf was broken, let's restore."
cat
"
$_backup_conf
"
>
"
$FOUND_REAL_NGINX_CONF
"
cat
"
$_backup_conf
"
>
"
$FOUND_REAL_NGINX_CONF
"
return
1
return
1
fi
fi
_info
"Reload nginx"
_info
"Reload nginx"
if
!
_exec
"nginx -s reload"
>
/dev/null
;
then
if
!
nginx
-s
reload
>
/dev/null
;
then
_exec_err
_err
"It seems that nginx reload error, let's restore."
_err
"It seems that nginx reload error, let's restore."
cat
"
$_backup_conf
"
>
"
$FOUND_REAL_NGINX_CONF
"
cat
"
$_backup_conf
"
>
"
$FOUND_REAL_NGINX_CONF
"
return
1
return
1
...
@@ -3346,8 +3323,7 @@ _restoreNginx() {
...
@@ -3346,8 +3323,7 @@ _restoreNginx() {
done
done
_info
"Reload nginx"
_info
"Reload nginx"
if
!
_exec
"nginx -s reload"
>
/dev/null
;
then
if
!
nginx
-s
reload
>
/dev/null
;
then
_exec_err
_err
"It seems that nginx reload error, please report bug."
_err
"It seems that nginx reload error, please report bug."
return
1
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