From e1d27f344c70c68e3c44f37e5b65794fb586fe6b Mon Sep 17 00:00:00 2001 From: Tyler Date: Fri, 13 Jan 2023 14:35:28 -0800 Subject: [PATCH] runtime env improvement --- kjv-api-test.sh | 8 +++++++- kjv-api.sh | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kjv-api-test.sh b/kjv-api-test.sh index 620a5eb..0146a4d 100755 --- a/kjv-api-test.sh +++ b/kjv-api-test.sh @@ -1,3 +1,9 @@ #!/bin/sh # run from current directory only -uwsgi_python3 --http-socket 0.0.0.0:1612 --wsgi-file app.py --callable app +FILE=app.py +if test -f "$FILE"; then + uwsgi_python3 --http-socket 0.0.0.0:1612 --wsgi-file app.py --callable app +else + cd /opt/kjv-api + uwsgi_python3 --http-socket 0.0.0.0:1612 --wsgi-file /opt/kjv-api/app.py --callable app +fi diff --git a/kjv-api.sh b/kjv-api.sh index e7011e0..f696fd4 100755 --- a/kjv-api.sh +++ b/kjv-api.sh @@ -1,2 +1,3 @@ #!/bin/sh +cd /opt/kjv-api uwsgi_python3 --http-socket :1611 --wsgi-file /opt/kjv-api/app.py --callable app --stats 127.0.0.1:9191