@@ -2936,22 +2936,6 @@ _initpath() {
29362936
29372937}
29382938
2939- _exec () {
2940- if [ -z " $_EXEC_TEMP_ERR " ]; then
2941- _EXEC_TEMP_ERR=" $( _mktemp) "
2942- fi
2943-
2944- if [ " $_EXEC_TEMP_ERR " ]; then
2945- eval " $@ 2>>$_EXEC_TEMP_ERR "
2946- else
2947- eval " $@ "
2948- fi
2949- }
2950-
2951- _exec_err () {
2952- [ " $_EXEC_TEMP_ERR " ] && _err " $( cat " $_EXEC_TEMP_ERR " ) " && echo " " > " $_EXEC_TEMP_ERR "
2953- }
2954-
29552939_apachePath () {
29562940 _APACHECTL=" apachectl"
29572941 if ! _exists apachectl; then
@@ -2964,8 +2948,7 @@ _apachePath() {
29642948 fi
29652949 fi
29662950
2967- if ! _exec $_APACHECTL -V > /dev/null; then
2968- _exec_err
2951+ if ! $_APACHECTL -V > /dev/null; then
29692952 return 1
29702953 fi
29712954
@@ -3017,8 +3000,7 @@ _restoreApache() {
30173000
30183001 cat " $APACHE_CONF_BACKUP_DIR /$httpdconfname " > " $httpdconf "
30193002 _debug " Restored: $httpdconf ."
3020- if ! _exec $_APACHECTL -t; then
3021- _exec_err
3003+ if ! $_APACHECTL -t; then
30223004 _err " Sorry, restore apache config error, please contact me."
30233005 return 1
30243006 fi
@@ -3036,8 +3018,7 @@ _setApache() {
30363018 # test the conf first
30373019 _info " Checking if there is an error in the apache config file before starting."
30383020
3039- if ! _exec " $_APACHECTL " -t > /dev/null; then
3040- _exec_err
3021+ if ! $_APACHECTL -t > /dev/null; then
30413022 _err " The apache config file has error, please fix it first, then try again."
30423023 _err " Don't worry, there is nothing changed to your system."
30433024 return 1
@@ -3098,8 +3079,7 @@ Allow from all
30983079 chmod 755 " $ACME_DIR "
30993080 fi
31003081
3101- if ! _exec " $_APACHECTL " graceful; then
3102- _exec_err
3082+ if ! $_APACHECTL graceful; then
31033083 _err " $_APACHECTL graceful error, please contact me."
31043084 _restoreApache
31053085 return 1
@@ -3184,8 +3164,7 @@ _setNginx() {
31843164 return 1
31853165 fi
31863166 _info " Check the nginx conf before setting up."
3187- if ! _exec " nginx -t" > /dev/null; then
3188- _exec_err
3167+ if ! nginx -t > /dev/null; then
31893168 return 1
31903169 fi
31913170
@@ -3212,16 +3191,14 @@ location ~ \"^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)\$\" {
32123191 fi
32133192 _debug3 " Modified config:$( cat $FOUND_REAL_NGINX_CONF ) "
32143193 _info " nginx conf is done, let's check it again."
3215- if ! _exec " nginx -t" > /dev/null; then
3216- _exec_err
3194+ if ! nginx -t > /dev/null; then
32173195 _err " It seems that nginx conf was broken, let's restore."
32183196 cat " $_backup_conf " > " $FOUND_REAL_NGINX_CONF "
32193197 return 1
32203198 fi
32213199
32223200 _info " Reload nginx"
3223- if ! _exec " nginx -s reload" > /dev/null; then
3224- _exec_err
3201+ if ! nginx -s reload > /dev/null; then
32253202 _err " It seems that nginx reload error, let's restore."
32263203 cat " $_backup_conf " > " $FOUND_REAL_NGINX_CONF "
32273204 return 1
@@ -3346,8 +3323,7 @@ _restoreNginx() {
33463323 done
33473324
33483325 _info " Reload nginx"
3349- if ! _exec " nginx -s reload" > /dev/null; then
3350- _exec_err
3326+ if ! nginx -s reload > /dev/null; then
33513327 _err " It seems that nginx reload error, please report bug."
33523328 return 1
33533329 fi
0 commit comments