-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprepare
executable file
·71 lines (68 loc) · 2.4 KB
/
prepare
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
#!/bin/bash
# +----------------------------------------------------------------------------+
# | MM5D v0.6 * Growing house controlling and remote monitoring system |
# | Copyright (C) 2019-2023 Pozsár Zsolt <[email protected]> |
# | prepare |
# | Prepare OS |
# +----------------------------------------------------------------------------+
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the European Union Public License 1.1 version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.
line()
{
for ((i=0; i<${#SWCR}; i++))
do
echo -n "-"
done
echo ""
}
# constants
SWN1="MM5D"
SWN2="mm5d"
SWCR=`cat documents/copyright`
SWV=`cat documents/VERSION`
# prepare
echo -e "\n$SWN1 v$SWV prepare OS"
echo "$SWCR"
line
sleep 1
echo "Installing required components..."
sudo apt-get install apache2 \
build-essential \
git \
gnuplot \
libfreetype6-dev \
libjpeg-dev \
libswitch-perl \
python3-daemon \
python3-dev \
python3-openssl \
python3-pip \
python3-requests \
python3-rpi.gpio \
python-configparser \
libconfig-tiny-perl \
wget
echo -e "\nCloning 3rd party softwares from Github..."
mkdir --parents $HOME/download
cd $HOME/download
# clone sensor software
git clone https://github.com/adafruit/Adafruit_Python_DHT.git
cd Adafruit_Python_DHT
sudo python3 setup.py install
cd ..
# clone display software
git clone http://github.com/rm-hull/luma.led_matrix.git
cd luma.led_matrix
sudo python3 setup.py install
cd ..
echo -e "\nSetting Apache2..."
sudo ln --force --symbolic /etc/apache2/mods-available/cgid.load /etc/apache2/mods-enabled/
sudo ln --force --symbolic /etc/apache2/mods-available/cgid.conf /etc/apache2/mods-enabled/
sudo ln --force --symbolic /etc/apache2/conf-available/serve-cgi-bin.conf /etc/apache2/conf-enabled/
sudo /etc/init.d/apache2 restart
echo -e "\nDone."