-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathpifinder_post_update.sh
More file actions
89 lines (77 loc) · 2.68 KB
/
Copy pathpifinder_post_update.sh
File metadata and controls
89 lines (77 loc) · 2.68 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
git submodule update --init --recursive
# python/tetra3 must be a symlink to the tetra3 package inside the
# cedar-solve submodule. It is deliberately untracked (see ADR 0035):
# older installs have a plain folder or an absolute symlink here, and a
# tracked version makes `git pull` refuse to update those units. Anything
# else at this path is moved aside (kept, not deleted) and the symlink is
# (re)created on every update.
TETRA3_LINK="/home/pifinder/PiFinder/python/tetra3"
TETRA3_TARGET="PiFinder/tetra3/tetra3"
if [ -e "$TETRA3_LINK" ] || [ -L "$TETRA3_LINK" ]
then
if [ "$(readlink "$TETRA3_LINK")" != "$TETRA3_TARGET" ]
then
mv "$TETRA3_LINK" "/home/pifinder/tetra3_old_$(date +%Y%m%d-%H%M%S)"
fi
fi
if ! [ -L "$TETRA3_LINK" ]
then
ln -s "$TETRA3_TARGET" "$TETRA3_LINK"
fi
sudo pip install -r /home/pifinder/PiFinder/python/requirements.txt
# Set up migrations folder if it does not exist
if ! [ -d "/home/pifinder/PiFinder_data/migrations" ]
then
mkdir /home/pifinder/PiFinder_data/migrations
fi
# v1.x.x
# everying prior to selecitve migrations
if ! [ -f "/home/pifinder/PiFinder_data/migrations/v1.x.x" ]
then
source /home/pifinder/PiFinder/migration_source/v1.x.x.sh
touch /home/pifinder/PiFinder_data/migrations/v1.x.x
fi
# v2.1.0
# Switch to Cedar
if ! [ -f "/home/pifinder/PiFinder_data/migrations/v2.1.0" ]
then
source /home/pifinder/PiFinder/migration_source/v2.1.0.sh
touch /home/pifinder/PiFinder_data/migrations/v2.1.0
fi
# v2.2.1
# Install libinput
if ! [ -f "/home/pifinder/PiFinder_data/migrations/v2.2.1" ]
then
source /home/pifinder/PiFinder/migration_source/v2.2.1.sh
touch /home/pifinder/PiFinder_data/migrations/v2.2.1
fi
# v2.2.2
# Enable host usb on usb-c port
if ! [ -f "/home/pifinder/PiFinder_data/migrations/v2.2.2" ]
then
source /home/pifinder/PiFinder/migration_source/v2.2.2.sh
touch /home/pifinder/PiFinder_data/migrations/v2.2.2
fi
# v2.4.0
# Switch detect to system process
if ! [ -f "/home/pifinder/PiFinder_data/migrations/v2.4.0" ]
then
source /home/pifinder/PiFinder/migration_source/v2.4.0.sh
touch /home/pifinder/PiFinder_data/migrations/v2.4.0
fi
# v2.6.0
# Clear stale flop_image=true on the default Dobsonian (flip/flop now live)
if ! [ -f "/home/pifinder/PiFinder_data/migrations/v2.6.0" ]
then
source /home/pifinder/PiFinder/migration_source/v2.6.0.sh
touch /home/pifinder/PiFinder_data/migrations/v2.6.0
fi
# v2.6.1
# RemoveIPC=no so SSH logouts can't reap the solver's shared memory
if ! [ -f "/home/pifinder/PiFinder_data/migrations/v2.6.1" ]
then
source /home/pifinder/PiFinder/migration_source/v2.6.1.sh
touch /home/pifinder/PiFinder_data/migrations/v2.6.1
fi
# DONE
echo "Post Update Complete"