mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-04-19 08:55:12 +00:00
refactored
This commit is contained in:
parent
c0fbf4dd0c
commit
94a0d5a0a4
14
src/wgd.sh
14
src/wgd.sh
@ -57,8 +57,7 @@ check_wgd_status(){
|
||||
fi
|
||||
}
|
||||
|
||||
start_wgd () {
|
||||
if [[ $environment == 'production' ]]; then
|
||||
gunicorn_start () {
|
||||
printf "%s\n" "$dashes"
|
||||
printf "| Starting WGDashboard in the background. |\n"
|
||||
if [ ! -d "log" ]
|
||||
@ -72,6 +71,15 @@ start_wgd () {
|
||||
--error-logfile log/error_"$d".log 'dashboard:run_dashboard()'
|
||||
printf "| Log files is under log/ |\n"
|
||||
printf "%s\n" "$dashes"
|
||||
}
|
||||
|
||||
gunicorn_stop () {
|
||||
kill $(cat ./gunicorn.pid)
|
||||
}
|
||||
|
||||
start_wgd () {
|
||||
if [[ $environment == 'production' ]]; then
|
||||
gunicorn_start
|
||||
else
|
||||
printf "%s\n" "$dashes"
|
||||
printf "| Starting WGDashboard in the background. |\n"
|
||||
@ -87,7 +95,7 @@ start_wgd () {
|
||||
|
||||
stop_wgd() {
|
||||
if [[ $environment == 'production' ]]; then
|
||||
kill $(cat ./gunicorn.pid)
|
||||
gunicorn_stop
|
||||
else
|
||||
kill "$(ps aux | grep "[p]ython3 $app_name" | awk '{print $2}')"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user