Remote-Mouse/src/linux-start.sh

30 lines
850 B
Bash
Raw Permalink Normal View History

2020-05-28 18:07:53 +00:00
#!/bin/bash
# set -o xtrace ## To debug scripts
# set -o errexit ## To exit on error
# set -o errunset ## To exit if a variable is referenced but not set
function main() {
2020-11-23 00:15:20 +00:00
SCRIPTPATH="$( cd "$(dirname "")" >/dev/null 2>&1 ; pwd -P )"
cd "${SCRIPTPATH}"
echo "Working Dir: " $(pwd)
2020-07-02 02:55:56 +00:00
source "../venv/bin/activate"
2020-11-23 00:15:20 +00:00
2021-07-19 02:59:33 +00:00
LOG_LEVEL=error
2020-11-23 00:15:20 +00:00
WORKER_COUNT=1
ADDR=127.0.0.1
PORT=8088
2021-07-19 02:59:33 +00:00
TIMEOUT=60
2020-11-23 00:15:20 +00:00
2020-05-28 18:07:53 +00:00
# Note can replace 127.0.0.1 with 0.0.0.0 to make it 'network/internet' accessable...
2020-06-29 02:55:58 +00:00
# Note: NEED -k eventlet for this to work! I spent too many hours on this...
2020-11-23 00:15:20 +00:00
# <module>:<app> IE <file>:<flask app variable>
2021-07-19 02:59:33 +00:00
gunicorn wsgi:app -b $ADDR:$PORT \
2020-11-23 00:15:20 +00:00
-k eventlet \
-w $WORKER_COUNT \
--timeout $TIMEOUT \
--log-level $LOG_LEVEL
2020-05-28 18:07:53 +00:00
}
main $@;