Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid unnecessary eval #4662

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions acme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2942,9 +2942,9 @@ _exec() {
fi

if [ "$_EXEC_TEMP_ERR" ]; then
eval "$@ 2>>$_EXEC_TEMP_ERR"
"$@" 2>>"$_EXEC_TEMP_ERR"
else
eval "$@"
"$@"
fi
}

Expand All @@ -2964,7 +2964,7 @@ _apachePath() {
fi
fi

if ! _exec $_APACHECTL -V >/dev/null; then
if ! _exec "$_APACHECTL" -V >/dev/null; then
_exec_err
return 1
fi
Expand Down Expand Up @@ -3017,7 +3017,7 @@ _restoreApache() {

cat "$APACHE_CONF_BACKUP_DIR/$httpdconfname" >"$httpdconf"
_debug "Restored: $httpdconf."
if ! _exec $_APACHECTL -t; then
if ! _exec "$_APACHECTL" -t; then
_exec_err
_err "Sorry, restore apache config error, please contact me."
return 1
Expand Down Expand Up @@ -3184,7 +3184,7 @@ _setNginx() {
return 1
fi
_info "Check the nginx conf before setting up."
if ! _exec "nginx -t" >/dev/null; then
if ! _exec nginx -t >/dev/null; then
_exec_err
return 1
fi
Expand Down Expand Up @@ -3212,15 +3212,15 @@ location ~ \"^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)\$\" {
fi
_debug3 "Modified config:$(cat $FOUND_REAL_NGINX_CONF)"
_info "nginx conf is done, let's check it again."
if ! _exec "nginx -t" >/dev/null; then
if ! _exec nginx -t >/dev/null; then
_exec_err
_err "It seems that nginx conf was broken, let's restore."
cat "$_backup_conf" >"$FOUND_REAL_NGINX_CONF"
return 1
fi

_info "Reload nginx"
if ! _exec "nginx -s reload" >/dev/null; then
if ! _exec nginx -s reload >/dev/null; then
_exec_err
_err "It seems that nginx reload error, let's restore."
cat "$_backup_conf" >"$FOUND_REAL_NGINX_CONF"
Expand Down Expand Up @@ -3346,7 +3346,7 @@ _restoreNginx() {
done

_info "Reload nginx"
if ! _exec "nginx -s reload" >/dev/null; then
if ! _exec nginx -s reload >/dev/null; then
_exec_err
_err "It seems that nginx reload error, please report bug."
return 1
Expand Down