From de94765169094755eb86d8ce83b2ecd51a83792d Mon Sep 17 00:00:00 2001 From: Bohung Date: Thu, 7 Apr 2022 11:42:17 +0800 Subject: [PATCH] Update start_site.sh and init_web.sh --- init_web.sh | 2 +- start_site.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/init_web.sh b/init_web.sh index 4d48a1b..45b8f1b 100644 --- a/init_web.sh +++ b/init_web.sh @@ -1 +1 @@ -sudo service nginx restart && sudo service mongod restart && ./start_site.sh $1 && curl localhost \ No newline at end of file +sudo service nginx restart && sudo service mongod restart && ./start_site.sh $1 $2 $3 $4 && curl localhost \ No newline at end of file diff --git a/start_site.sh b/start_site.sh index a4c7927..a9f5605 100644 --- a/start_site.sh +++ b/start_site.sh @@ -1,5 +1,9 @@ rails_env=$1 if [ -z $rails_env ]; then - rails_env=development + rails_env=development fi -bundle exec unicorn_rails -c config/unicorn.rb -D -E $rails_env \ No newline at end of file +daemon_args="" +if [[ "$2" != "-ND" ]]; then + daemon_args="-D" +fi +bundle exec unicorn_rails -c config/unicorn.rb -E $rails_env $daemon_args $3 "$4" \ No newline at end of file