-
Notifications
You must be signed in to change notification settings - Fork 49
/
run.sh
executable file
·46 lines (38 loc) · 1.04 KB
/
run.sh
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
40
41
42
43
44
45
46
#!/bin/bash
# Get project root, assumes this script is in project root
PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $PROJECT_ROOT
# Source virtual environment
source $PROJECT_ROOT/venv/bin/activate
# Only if we are on linux, we run a light weight web server to vend images
#if [[ "$OSTYPE" == "linux"* ]]; then
# sudo pkill busybox
# sudo busybox httpd -p 8088 -h $PROJECT_ROOT/data/images/
#fi
# Initialize command line arg default values
NO_DEVICE="false"
SIMULATE="false"
# Get command line arguments
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--no-device) shift
NO_DEVICE="true"
;;
--simulate) shift
SIMULATE="true"
;;
*)
POSITIONAL+=("$1")
shift
;;
esac
done
set -- "${POSITIONAL[@]}"
# Export command line arguments
export NO_DEVICE
export SIMULATE
# Run app
python3.6 manage.py runserver 0.0.0.0:8000