-
Notifications
You must be signed in to change notification settings - Fork 5
/
installer.sh
executable file
·87 lines (73 loc) · 1.88 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
#installer
startingdir="`pwd`"
echo "running in $startingdir"
#install node
#is node installed?
nodepath="/opt/node/bin/node"
if [ -e "$nodepath" ]
then
echo "Node already installed in $nodepath"
else
echo "Installing Node @ $nodepath."
wget http://nodejs.org/dist/v0.10.21/node-v0.10.21-linux-arm-pi.tar.gz
tar -zxvf node-v0.10.21-linux-arm-pi.tar.gz
sudo mkdir /opt/node
sudo cp -r node-v0.10.21-linux-arm-pi/* /opt/node
# TODO : Add /opt/node to the PATH
# sudo vi /etc/profile
#Add the following lines to the configuration file before the ‘export’ command.
#NODE_JS_HOME="/opt/node"
#PATH="$PATH:$NODE_JS_HOME/bin"
#export PATH
fi
cd ~
pifacepath="piface"
#is piface installed
if [ -e "$pifacepath" ]
then
echo "PiFace already installed in $pifacepath"
else
echo "Installing Piface @ $pifacepath."
sudo apt-get update
sudo apt-get install automake libtool git
git clone https://github.com/thomasmacpherson/piface.git
cd piface/c
./autogen.sh && ./configure && make && sudo make install
sudo ldconfig
cd ../scripts
sudo ./spidev-setup
fi
cd ~
wiringpipath="wiringPi"
#is wiringpi installed
if [ -e "$wiringpipath" ]
then
echo "wiringPi already installed in $wiringpipath"
else
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
fi
cd $startingdir
echo "staring node.js library install with npm"
/opt/node/bin/npm install
# TODO : Server setup
#ask about PiBrella?
#server setup start
#get waterbear
waterbearpath="waterbear/index.html"
#is piface installed
if [ -e "$waterbearpath" ]
then
echo "Waterbear already installed in $waterbearpath"
else
echo "Installing Waterbear @ $waterbearpath."
git submodule init
git submodule update
cd waterbear
#git checkout master
cd ..
fi
echo "Installer finished ..."
echo "Type waterbear.sh"