-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
63 lines (57 loc) · 1.95 KB
/
Copy pathinstall
File metadata and controls
63 lines (57 loc) · 1.95 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
#!/bin/bash
required_os1="GNU/Linux";
required_os1_out=$(uname -o);
supported_models=("Raspberry Pi 4 Model B Rev");
device_tree_model=$(cat /proc/device-tree/model | tr '\0' '\n');
if [[ $required_os1_out != "$required_os1" ]]; then
echo "You aren't on a supported system. System type must be of GNU/Linux.";
exit;
fi;
supported_devtree_model=false;
for i in "${supported_models[@]}"; do
if [[ $device_tree_model == *$i* ]]; then
echo "Supported model of Raspberry Pi.";
echo ".. $device_tree_model";
supported_devtree_model=true;
fi;
done
if [[ $supported_devtree_model == false ]]; then
echo "You are not on a supported device model. Cannot run the installer. Supported device models are listed below.";
echo "$supported_models";
echo "Your model is '$device_tree_model' which is unsupported or not tested.";
exit;
fi;
echo "Welcome to Raspberry Pi Software!";
echo "Gathering needed packages...";
python311_out=$(python --version);
if [[ $python311_out == "Python 3.11"* ]]; then
echo "Supported Python Version: $python311_out";
else
echo "Error. The install could not continue. Please download Python v3.11 or greater.";
exit;
fi;
if [[ -d "/bin" ]]; then
echo "Installing rpisft...";
cp installer.bin/rpisft /bin/rpisft;
sudo chmod +x /bin/rpisft;
echo "RPISFT> Initialising...";
rpisft first-installation;
echo "Installed rpisft.";
echo "Verifying installation...";
if [[ -e "/bin/rpisft" ]]; then
echo "Installation has been verified.";
else
echo "Installation has not been verified. Tool couldn't be installed.";
echo "The installer failed: you may need to provide root access or the respectable privilages.";
echo "Exiting...";
exit;
fi;
else
echo "/bin: No such file or directory.";
echo "The installer encountered an error and can't continue.";
exit;
fi;
echo "The packages tool by Raspberry Pi Software has successfully been installed.";
echo "Exiting in 10 seconds.";
sleep 10;
exit;