forked from macnow/homebridge-raspbian-installer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·37 lines (34 loc) · 1.15 KB
/
install.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
#!/bin/bash
set -x
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y git make libavahi-compat-libdnssd-dev dialog
wget https://nodejs.org/dist/v7.4.0/node-v7.4.0-linux-armv7l.tar.xz
sudo tar -xf node-v7.4.0-linux-armv7l.tar.xz
cd node-v7.4.0-linux-armv7l/
sudo cp -R * /usr/local/
cd
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
source ~/.profile
sudo npm install -g --unsafe-perm homebridge hap-nodejs node-gyp json
cd /usr/local/lib/node_modules/homebridge/
sudo npm install --unsafe-perm bignum
cd -
cd /usr/local/lib/node_modules/hap-nodejs/node_modules/mdns
sudo node-gyp BUILDTYPE=Release rebuild
cd -
cd /etc/default && sudo wget https://www.dropbox.com/s/efhj7bll9yq5tgl/homebridge
cd /etc/systemd/system && sudo wget https://www.dropbox.com/s/k610k1ens6ozsvb/homebridge.service
cd
mkdir .homebridge
cd /home/pi/homebridge-raspbian-installer
sudo cp configs/config.json /home/pi/.homebridge/config.json
sudo chown -R pi:pi /home/pi/.homebridge/
sudo systemctl daemon-reload
sudo systemctl enable homebridge
sudo systemctl start homebridge
chmod +x scripts/*
chmod +x configure.sh
./configure.sh