#!/bin/sh
uid=`id -u`
if [ $uid -ne 0 ] ; then
  echo "you need to run this as root (with sudo)"
  exit 1
fi
apt-get -y update
apt-get -y upgrade
apt-get -y install git i2c-tools make build-essential gcc

if [ -d bw_rpi_tools ]; then
	cd bw_rpi_tools
	git pull
else
	git clone https://github.com/rewolff/bw_rpi_tools.git
	cd bw_rpi_tools
fi

# compile 
cd bw_tool
make
# install 
make install 
# compile bw_lcd


sed -i.orig -e 's/^blacklist/#blacklist/' /etc/modprobe.d/raspi-blacklist.conf
modprobe -a  i2c-bcm2708 spi-bcm2708 i2c-dev 

