From 33125f2154316f3cd6d4f065138ba989799a8cae Mon Sep 17 00:00:00 2001 From: minoplhy Date: Sun, 13 Oct 2024 19:10:31 +0700 Subject: [PATCH] nginx_build_script: handle make error --- nginx_build_script/build.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/nginx_build_script/build.sh b/nginx_build_script/build.sh index 26492f4..306fee7 100644 --- a/nginx_build_script/build.sh +++ b/nginx_build_script/build.sh @@ -203,8 +203,8 @@ case $SSL_LIB in # Golang GO_VERSION=1.23.1 - wget https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz - tar -C $HOMEDIRECTORY -xzf go$GO_VERSION.linux-amd64.tar.gz + wget https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz -O $HOMEDIRECTORY/go$GO_VERSION.linux-amd64.tar.gz + tar -C $HOMEDIRECTORY -xzf $HOMEDIRECTORY/go$GO_VERSION.linux-amd64.tar.gz export PATH=$PATH:$HOMEDIRECTORY/go/bin git clone --depth=1 https://github.com/google/boringssl $HOMEDIRECTORY/boringssl @@ -404,6 +404,7 @@ elif [ $SSL_LIB == "libressl" ]; then fi make +exit_code=$? ################################# ## ## @@ -411,7 +412,7 @@ make ## ## ################################# -if [[ $Nginx_Install == "yes" || $INSTALL == true ]]; then +if [[ "$Nginx_Install" == "yes" || "$INSTALL" == true ]] && [ "$exit_code" -eq 0 ]; then mkdir -p /lib/nginx/ && mkdir -p /lib/nginx/modules mkdir -p /etc/nginx && mkdir -p /etc/nginx/sites-enabled && mkdir -p /etc/nginx/modules-enabled cp $HOMEDIRECTORY/nginx/objs/*.so /lib/nginx/modules @@ -431,6 +432,8 @@ EOL fi cp modules.conf /etc/nginx/modules-enabled +elif [[ ! $exit_code -eq 0 ]]; then + printf "Nginx Build Failed..." else - echo "Nginx_Install variable isn't set/vaild. Your Nginx assets location is : '$HOMEDIRECTORY'/nginx/objs" -fi + printf "Nginx_Install variable isn't set/vaild. Your Nginx assets location is : '%s'/nginx/objs" $HOMEDIRECTORY +fi \ No newline at end of file