Created
January 30, 2020 19:56
-
-
Save andrewodri/8dabf9c0e1fc23fd37335abf82cd38b4 to your computer and use it in GitHub Desktop.
HomeBridge System Services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rsync -avz -e 'ssh' --exclude='assets' --exclude='node_modules' ./ pi@raspberrypi:~/homebridge/ | |
rsync -avz -e 'ssh' ~/.ssh/id_rsa.pub pi@raspberrypi:~/.ssh/authorized_keys | |
ssh pi@raspberrypi | |
chmod 600 ~/.ssh/authorized_keys | |
mkdir ~/.homebridge | |
cd homebridge | |
npm install | |
sudo sh -c 'echo "[Unit] | |
Description=Homebridge Server | |
[Service] | |
PIDFile=/tmp/homebridge-99.pid | |
User=pi | |
Group=pi | |
Restart=always | |
KillSignal=SIGQUIT | |
WorkingDirectory=/home/pi/homebridge/ | |
ExecStart=/usr/bin/npm start --prefix /home/pi/homebridge/ | |
[Install] | |
WantedBy=multi-user.target" > /lib/systemd/system/homebridge.service' | |
sudo systemctl daemon-reload | |
sudo systemctl enable homebridge | |
sudo systemctl start homebridge | |
journalctl -u homebridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment