-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-install
More file actions
45 lines (43 loc) · 1.57 KB
/
Copy pathpost-install
File metadata and controls
45 lines (43 loc) · 1.57 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
#!/bin/bash
# Device Manager | Post installation commands
echo "DEVCMGR> Determining pip configuration...";
testcommand=$(pip install flask);
if [[ $testcommand == *"externally-managed-environment"* ]]; then
tput setaf 1;
echo "There was an error. Adding --break-system-packages to command...";
tput sgr0;
tput setaf 2;
echo 'Installing flask...';
pip install --break-system-packages flask;
echo 'Installing PyQt5...';
pip install --break-system-packages PyQt5;
echo 'Installing PySide6...';
pip install --break-system-packages PySide6;
else
tput setaf 1;
echo "There was an error. Adding --break-system-packages to command...";
tput sgr0;
tput setaf 2;
echo 'Installing flask...';
pip install --break-system-packages flask;
echo 'Installing PyQt5...';
pip install --break-system-packages PyQt5;
echo 'Installing PySide6...';
pip install --break-system-packages PySide6;
fi;
echo 'Trying to install tkinter...';
sudo apt install -y python3-tk;
echo 'Making rpisftware.device-manager.service';
if [[ -e rpisftware.device-manager.service ]]; then
echo "? Service file exists.";
echo "Making rpisftware.device-manager.service (copying)";
cp rpisftware.device-manager.service /etc/systemd/system;
# activate the device manager service file to start on boot
sudo systemctl start rpisftware.device-manager.service;
sudo systemctl enable rpisftware.device-manager.service;
else
tput setaf 1;
echo "There was an error. Service file doesn't exist.";
echo "DEVCMGR> Fatal error: the install could not continue.\n Stop code: BAD_SERVC_FILE";
exit;
fi;