-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.dev
executable file
·39 lines (30 loc) · 866 Bytes
/
run.dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Target: main script to run the app in dev mode (not for the production as without wsgi)
# Version: 0.1
# Date: 2017/01/04
# Mail: [email protected]
# Copyright 2017 GPL - Guillain
# Thanks to run it from the root app folder
HOST=0.0.0.0
PORT=8080
export ROOT_DIR="`pwd`"
export CONF_DIR="${ROOT_DIR}/conf"
export LOG_DIR="${ROOT_DIR}/log"
export FLASK_APP='TechRequest'
export FLASK_DEBUG=1
export FLASK_SETTING="${CONF_DIR}/settings.cfg"
case $1 in
start) python -m flask run --host $HOST --port $PORT > ${LOG_DIR}/all.log 2>&1 &;;
stop) kill -9 `ps aux | grep $PORT | grep $HOST | awk '{print $2}'`;;
restart)
$0 stop
$0 start
;;
status)
ps aux | grep $PORT;;
manual)
python -m flask run --host $HOST --port $PORT;;
*) echo "command not found";;
esac
echo "ToDo for exposure: lt -s techrequest -p 80"
exit 0