forked from alexnathanson/solar-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.sh
61 lines (39 loc) · 1.37 KB
/
installer.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
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
#NOT TESTED YET!!!
# prior to this, configure the device with raspi-config
# after this, complete the security installation steps manually
echo 'Solar Protocol Installer V0.0.1 - NOT TESTED YET!!!'
###### OS ######
#update and upgrade your pi
echo 'updating OS'
sudo apt-get update
echo 'upgrading OS'
sudo apt-get upgrade
###### REPOSITORY ######
echo 'cloning repository'
#clone the git hub repository
cd /home/pi
git clone http://www.github.com/alexnathanson/solar-protocol
#copy the local directory to outside the repository
sudo cp -r /home/pi/solar-protocol/local /home/pi/local
#set permissions for all SP files
sh /home/pi/solar-protocol/utilities/setAllPermissions.sh
###### PYTHON PACKAGES ######
echo 'installing python packages'
sudo apt-get install python3-pip
pip3 install -r requirements.txt
###### SECURITY ######
###### SERVER ######
echo 'installing Apache server'
echo 'Apache configuration is not automated at this time.'
echo 'See configuration instructions at:'
echo 'https://github.com/alexnathanson/solar-protocol/blob/master/installation.md'
# install Apache
sudo apt-get install apache2 -y
# install PHP
sudo apt-get install php -y
#Change Apache default directory to the frontend directory
cd /etc/apache2/sites-available
###### AUTOMATION ######
echo 'automating charge controller data collection'
echo 'automate charger controller runner'