-
Notifications
You must be signed in to change notification settings - Fork 8
/
upserver.sh
57 lines (49 loc) · 1.13 KB
/
upserver.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
53
54
55
56
57
#!/bin/bash
# Check Node Install
if [[ ! `npm --help` ]]; then
echo "Please install node"
exit
fi
# Restart Motion
if [[ `motion --help` ]]; then
while sudo killall motion;
do
sleep 1
done
sudo rm /etc/motion/motion.conf
sudo cp ./services/motion/motion.conf /etc/motion/motion.conf
sudo motion
else
echo "Motion not found"
echo "Run: sudo apt-get install motion"
exit
fi
# Install Node Depencencies
if [[ ! -d "./node_modules" ]]; then
npm i
fi
# Start Server
if [[ ! `pm2 --help` ]]; then
npm i -g pm2
fi
if [[ `pm2 --help` ]]; then
echo "Staring Node API"
pm2 del all
pm2 start index.js
pm2 save
pm2 startup
fi
#Initialize Proxy Manager
cd services/proxy
if [[ ! -f "config.json" ]]; then
cp config_base.json config.json
fi
docker-compose down
docker-compose up -d
echo "Node API - Shold Listen on 8080"
echo "Node API UI - Shold Listen on 8081"
echo "Motion Web - Shold Listen on 3081"
echo "Motion Stream - Shold Listen on 3081"
echo "Proxy Admin - Should Listen HTTP on 81"
echo "Proxy - Should Listen HTTP on 80"
echo "Proxy - Should Listen HTTPS on 443"