From 37c91ac0d724942d5e971fd7c9b073dc1ff6899b Mon Sep 17 00:00:00 2001 From: minoplhy Date: Sat, 27 Apr 2024 23:03:14 +0700 Subject: [PATCH] nginx_build_script: add: install via argument --- nginx_build_script/README.md | 8 ++++++++ nginx_build_script/build.sh | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/nginx_build_script/README.md b/nginx_build_script/README.md index 239fb06..55fd596 100644 --- a/nginx_build_script/README.md +++ b/nginx_build_script/README.md @@ -7,6 +7,11 @@ export Nginx_Install=yes # This variable is required if you want Nginx to be in curl https://raw.githubusercontent.com/minoplhy/scriptbox/main/nginx_build_script/build.sh > ~/nginx_scriptbox.sh bash ~/nginx_scriptbox.sh ``` +new way to run! : +```bash +# With install Nginx +curl https://raw.githubusercontent.com/minoplhy/scriptbox/main/nginx_build_script/build.sh | bash -s -- --install +``` # Arguments ```bash @@ -18,6 +23,9 @@ while [ ${#} -gt 0 ]; do --no-lua | -nl ) DISABLE_LUA=true # Not include Lua in building ;; + --install | -i ) + INSTALL=true # Install Nginx + ;; *) ;; esac diff --git a/nginx_build_script/build.sh b/nginx_build_script/build.sh index a246b05..f3bede8 100644 --- a/nginx_build_script/build.sh +++ b/nginx_build_script/build.sh @@ -8,6 +8,9 @@ while [ ${#} -gt 0 ]; do --no-lua | -nl ) DISABLE_LUA=true # Not include Lua in building ;; + --install | -i ) + INSTALL=true # Install Nginx + ;; *) ;; esac @@ -181,7 +184,7 @@ cd $HOMEDIRECTORY/nginx make -if [[ $Nginx_Install == "yes" ]]; then +if [[ $Nginx_Install == "yes" || $INSTALL == true ]]; 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