From 10e382f9f7b3f99c7dfd29e115d4263b2f20611a Mon Sep 17 00:00:00 2001 From: bohung Date: Tue, 24 May 2022 15:46:03 +0800 Subject: [PATCH] Fix nginx restart failed. --- install_orbit_environment.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install_orbit_environment.sh b/install_orbit_environment.sh index 4dbf126..bfb099e 100644 --- a/install_orbit_environment.sh +++ b/install_orbit_environment.sh @@ -12,6 +12,11 @@ sudo apt-get install -y postfix sudo service postfix start #install nginx 1.18 sudo apt install nginx -y +sudo nginx -t +nginx_status="$(echo $?)" +if [ $nginx_status != 0 ]; then + sudo sed -i 's/\([^#]include \/etc\/nginx\/sites-enabled\/*\)/\#\1/g' /etc/nginx/nginx.conf +fi sudo service nginx restart cd /etc/nginx/ sudo mkdir orbit_sites/