-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·52 lines (44 loc) · 1.21 KB
/
install.sh
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
#!/bin/sh
DEST="../RPiMRE"
if [ ! -d $DEST ]
then
echo "Need to create dirctory"
mkdir $DEST
echo "Created directory: $DEST"
else
echo "Working directory already present"
fi
if [ -f $DEST/access.py ]
then
echo "Database login details in access.py preserved"
else
cp access.py $DEST
echo "access.py copied into the working directory"
echo "Update with current database login details"
fi
FILES="bmp180.py ccPowerUsage.py heatingContinuous.py heatingOneShot.py heatingToAWS.py m_temp.py PCF8574Continuous.py system_info.py \
checkHeatingRunning.sh checkPCFRunning.sh checkPowerUsageRunning.sh"
echo ""
echo "Copying files into working directory"
for file in $FILES
do
echo $DEST/$file
# diff $file $DEST/$file
cp $file $DEST/$file
done
echo "Files copied."
echo
echo "Crontab setup contained in the file crontab.txt"
cat crontab.txt
echo
echo "Current Crontab setting are:"
crontab -l | grep "RPiMRE"
echo
# Need to work out what libraries are used for python3.
#echo "Now installing the MySQL python libraries"
#sudo apt-get install python-mysql.connector
sudo apt-get install python3-mysqldb
sudo apt-get install python3-smbus i2c-tools
sudo apt-get install python3-serial
#echo
echo "Install finished"