forked from tnewman/PIoT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoinstall.sh
executable file
·43 lines (28 loc) · 962 Bytes
/
autoinstall.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
#!/bin/bash
echo "PI of Things (PIoT) Auto-Installer"
if [ $(whoami) != "root" ]; then
echo "Script must be run as root! Exiting."
exit 1
fi
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install git python3-pip
git clone https://github.com/tnewman/piot /home/pi/PIoT
cd /home/pi/PIoT
python3 setup.py develop
pip3 install gunicorn
cp config.cfg.sample config.cfg
./initializedatabase.py
cp piotexportgpio.service /etc/systemd/system/piotexportgpio.service
cp piotreadsensors.service /etc/systemd/system/piotreadsensors.service
cp piotweb.service /etc/systemd/system/piotweb.service
systemctl daemon-reload
systemctl enable piotexportgpio.service
systemctl enable piotreadsensors.service
systemctl enable piotweb.service
systemctl restart piotexportgpio.service
systemctl restart piotreadsensors.service
systemctl restart piotweb.service
chown -R pi /home/pi/PIoT
chgrp -R pi /home/pi/PIoT
echo "PIoT Successfully Installed!"