-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·45 lines (33 loc) · 902 Bytes
/
install.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
#!/bin/bash -e
die () {
echo -e $1;
exit $2;
}
is_sh () {
value=$(ps -o args= -p "$$" | cut -f 1 -d " ")
test "sh" = $value
return
}
UNAME=$(uname -s)
command_exists () {
type "$1" &> /dev/null ;
}
if is_sh ; then
die "\n Please don't invoke with sh, install use ./install.sh"
fi
if [ "$EUID" -ne 0 ]; then
die "\n Please run as sudo." 1
fi
if ! command_exists python3 ; then
die "\n Sorry you need to have Python3 installed. Please install it and rerun this script." 1
fi
if [ "$UNAME" = "Darwin" ]; then
if ! command_exists brew ; then
die "\n Sorry you need to have brew installed. Please install it and rerun this script." 1
fi
fi
if lsof -i -P -n | grep 8010 > /dev/null 2>&1; then
die "\n Another process is running on port 8010."
fi
python3 -m pip install -r requirements.txt --ignore-installed
python3 install.py $1 --shell bash