-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·46 lines (44 loc) · 1.31 KB
/
Copy pathupdate.sh
File metadata and controls
executable file
·46 lines (44 loc) · 1.31 KB
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
# This script is started as a service from webserver.go when the user wants to update
# This service is NOT meant to be enabled, just run on demand
source source.sh
if ping -c 1 "www.google.com" &>/dev/null ; then
sleep 5
echo "Checking for updates..."
echo "Stopping Services"
sudo systemctl stop wire-pod
sudo systemctl stop vectorx-web
sudo systemctl stop opencv-ifc
cd $WIREPOD_HOME
echo "Updating Wire-Pod..."
#git reset --hard main
#git checkout main
sudo runuser -l $(logname) -c "cd $WIREPOD_HOME && git pull"
cd $WIREPOD_HOME
echo "Running Wire-Pod setup"
sudo ./setup.sh << DONE
3
DONE
echo "Make sure that wire-pod services run"
sudo rm /lib/systemd/system/wire-pod.service
sudo ./setup.sh daemon-enable
echo "Building chipper just in case..."
cd $VECTORX_HOME
sudo ./buildChipper.sh
cd $VECTORX_HOME
echo "Updating VectorX..."
#git reset --hard main
#git checkout main
sudo runuser -l $(logname) -c "cd $VECTORX_HOME && git pull"
echo "Setupping VectorX..."
sudo ./setup.sh -h
echo "Starting Wire-Pod"
sudo systemctl start wire-pod
echo "Restarting VectorX services"
#Actually it is already done by setup.sh...
sudo systemctl restart opencv-ifc
sudo systemctl restart vectorx-web
echo "Done"
else
echo "No internet connection, doing nothing"
fi