From c3eaaed43b16d7243e8038920c002686acf51661 Mon Sep 17 00:00:00 2001 From: Galonza Peter Date: Mon, 18 Oct 2021 03:10:50 +0300 Subject: [PATCH] fixed stop --- src/wgd.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/wgd.sh b/src/wgd.sh index b25c37a8..7a961995 100755 --- a/src/wgd.sh +++ b/src/wgd.sh @@ -42,11 +42,18 @@ install_wgd(){ check_wgd_status(){ - if ps aux | grep '[p]ython3 '$app_name > /dev/null; - then + if [[ $environment == 'production' ]]; then + if ps aux | grep -v grep | cat ./gunicorn.pid > /dev/null; then return 0 - else - return 1 + else + return 1 + fi + else + if ps aux | grep -v grep |grep '[p]ython3 '$app_name > /dev/null; then + return 0 + else + return 1 + fi fi }