forked from marsvaardig/osc-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
51 lines (29 loc) · 908 Bytes
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
## Install AFP
sudo apt-get install -y netatalk
### Replace afp.conf
sudo rm -f /etc/netatalk/afp.conf
sudo mv afp.conf-dist /etc/netatalk/afp.conf
### Create a dedicated AFP directory
mkdir ../videos
## Install Node.js & NPM
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
## Install dependencies
sudo apt-get install -y omxplayer
## Make Node.js service
sudo npm install forever -g
sudo npm install forever-service -g
sudo forever-service install osc-node
## Install OSC-Node
npm install
## write out current crontab
sudo crontab -l > mycron
## echo new cron into cron file
sudo echo "@reboot sudo mount /dev/sda1 /mnt/usb && sudo service osc-node start" >> mycron
sudo echo "@reboot sleep 20 && sudo $PWD/update.sh >> /dev/console" >> mycron
## install new cron file
sudo crontab mycron
sudo rm mycron
## Finish
sudo reboot