-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.sh
34 lines (26 loc) · 1.01 KB
/
setup.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
#!/bin/bash
if [[ $(whoami) -ne 'root' ]]; then
echo "Must run as root!"
exit -1
fi
apt-get -y install python rpi-update git build-essential python-dev python-smbus python-pip python-cvxopt logrotate
echo "Installing logrotate config..."
cp espresso-mpc-logrotate /etc/logrotate.d
echo "Installing Adafruit GPIO library..."
cd ~
git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
cd ~/Adafruit_Python_GPIO
python setup.py install
echo "Installing MAX31855 Thermocouple Amp library..."
cd ~
git clone https://github.com/adafruit/Adafruit_Python_MAX31855.git
cd ~/Adafruit_Python_MAX31855
python setup.py install
echo "Installing cherrypy microframework"
pip install cherrypy
echo "Adding entry to /etc/rc.local"
cp /etc/rc.local /etc/rc.local.bak
cat /etc/rc.local | sed 's|^exit 0$| python /root/espresso-mpc/espresso-mpc.py > /root/espresso-mpc/espresso-mpc.log 2>\&1 \&\n\nexit 0|g' > /etc/rc.local.new
mv /etc/rc.local.new /etc/rc.local
chmod 755 /etc/rc.local
echo "Installation complete. Please reboot."