-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·53 lines (43 loc) · 993 Bytes
/
start.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
47
48
49
50
51
52
#!/bin/bash
HERE=`pwd`
NODE_MODULES=$HERE/node_modules
ALGORITHMS=$HERE/RPi.EIT-algorithms
HARDWARE=$HERE/RPi.EIT-hardware
WEB=$HERE/RPi.EIT-web
install_dependencies(){
npm install
}
run_server(){
npm start
#pm2 start app.js --watch
}
check_app(){
# echo $ALGORITHMS
# echo $HARDWARE
# echo $WEB
if [ -d $ALGORITHMS ]; then
echo -e "> Program for image reconstruction is exist"
else
echo -e "> Program for image reconstruction don't exist,"
echo -e "> Cloning RPi.EIT-algorithms..."
git clone https://github.com/agungdwiprasetyo/RPi.EIT-algorithms
fi
if [ -d $WEB ]; then
echo -e "> Program for web is exist\n"
else
echo -e "> Web source don't exist"
echo -e "> Cloning RPi.EIT-web..."
git clone https://github.com/agungdwiprasetyo/RPi.EIT-web
fi
}
run_app(){
if [ -d $NODE_MODULES ]; then
echo -e "> Node modules installed, running server\n"
run_server
else
echo -e "> Installing node modules...\n"
install_dependencies
fi
}
check_app
run_app