-
Notifications
You must be signed in to change notification settings - Fork 1
/
duskpi2.sh
41 lines (33 loc) · 1.03 KB
/
duskpi2.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
#!/bin/bash
# As "dusk" user
# Set variable containing the system's IP Address.
node_ip=$(hostname -I|cut -d" " -f 1)
# Download Dusk repository and install.
git clone https://github.com/octanolabs/dusk.git
cd dusk
npm install
export BASE_URL="https://ipaddress"
npm run build
# Create & edit the .dusk Supervisor dir, and related file to manage Caddy
mkdir -p /home/dusk/.dusk/supervisor
sudo tee -a /home/dusk/.dusk/supervisor/caddy.conf &>/dev/null <<"EOF"
[program:caddy]
command=/usr/bin/caddy run --config /etc/caddy/caddy.conf --adapter=caddyfile
autostart=true
autorestart=true
stderr_logfile=/var/log/caddy.err.log
stdout_logfile=/var/log/caddy.out.log
EOF
# Create & edit the Supervisor file to manage Dusk
sudo tee -a /home/dusk/.dusk/supervisor/dusk.conf &>/dev/null <<"EOF"
[program:dusk]
command=/usr/bin/npm run start
directory=/home/dusk/dusk
user=dusk
autostart=true
autorestart=true
stderr_logfile=/var/log/dusk.err.log
stdout_logfile=/var/log/dusk.out.log
EOF
# Exit Part 2 script back to Master script to complete setup.
exit