Add install script

Update filenames and paths for clean install
Rename sys-oled.py to sys-oled
Update README file with setup and usage instructions
This commit is contained in:
Gauthier Provost
2018-09-06 16:45:45 +08:00
parent 2737d9f8c6
commit 87c5911934
12 changed files with 109 additions and 41 deletions
Executable
+28
View File
@@ -0,0 +1,28 @@
#!/bin/sh
# Install script for sys-oled
INSTALL_PATH="/usr/local/"
SYSTEMD_PATH="/etc/systemd/"
DEPS="python-dev python-pip python-setuptools python-psutil libfreetype6-dev libjpeg-dev build-essential"
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root!"
exit 1
fi
echo "Installing Dependencies"
apt-get update
apt-get install -y $DEPS
echo "Installing luma.oled library"
pip install --upgrade luma.oled
echo "Installing sys-oled files"
cp -frv bin "$INSTALL_PATH"
cp -frv etc "$INSTALL_PATH"
cp -frv share "$INSTALL_PATH"
cp -frv system "$SYSTEMD_PATH"
echo "Enabling sys-oled at statup"
systemctl daemon-reload
systemctl enable sys-oled.service