-
Notifications
You must be signed in to change notification settings - Fork 18
/
ninja_install_software
executable file
·47 lines (35 loc) · 1.47 KB
/
ninja_install_software
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
#!/bin/bash
if [[ ! -f /etc/opt/ninja/.has_updated_software ]]
then
sleep 10
if [[ -f /etc/opt/ninja/.has_v0.8_npm ]]; then
wget https://s3.amazonaws.com/ninjablocks/binaries/beagle/npm-v1.1.64.tgz
tar -C / -xvzf npm-v1.1.64.tgz
rm npm-v1.1.64.tgz
touch /etc/opt/ninja/.has_v0.8_npm
fi;
echo "Installing node-gyp"
sudo npm install -g node-gyp
echo "Updating apt-get" >> /var/log/ninjablock.log
sudo apt-get update
echo "Installing ifplugd" >> /var/log/ninjablock.log
sudo apt-get -qq -y -f -m install ifplugd
sudo cp /opt/utilities/etc/default/ifplugd /etc/default/
echo "Installing avahi" >> /var/log/ninjablock.log
sudo apt-get -qq -y -f -m install avahi-daemon
echo "Installing ZigBee driver" >> /var/log/ninjablock.log
sudo apt-get -qq -y -f -m install libc6-armel-cross
sudo ln -sf /usr/arm-linux-gnueabi/lib/ld-linux.so.3 /lib/ld-linux.so.3
sudo ln -sf /usr/arm-linux-gnueabi/lib/libc.so.6 /lib/libc.so.6
su -c "/opt/utilities/bin/ninja_install ninja-zigbee" ubuntu
echo "Installing Belkin WeMo driver" >> /var/log/ninjablock.log
sudo apt-get -qq -y -f -m install libxml2-dev
su -c "/opt/utilities/bin/ninja_install ninja-belkin-wemo" ubuntu
echo "Cleaning apt-get" >> /var/log/ninjablock.log
sudo apt-get -qq clean
touch /etc/opt/ninja/.has_updated_software
echo "Background software install complete, restarting process" >> /var/log/ninjablock.log
chown -R ubuntu:ubuntu /home/ubuntu
chown -R ubuntu:ubuntu /opt/ninja
sudo service ninjablock restart
fi