forked from segler-alex/radiobrowser-api-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_from_dist.sh
executable file
·38 lines (30 loc) · 1.18 KB
/
install_from_dist.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
#!/bin/bash
set -e
sudo mkdir -p /usr/bin
sudo mkdir -p /usr/share/radiobrowser
sudo mkdir -p /var/log/radiobrowser
sudo cp target/release/radiobrowser-api-rust /usr/bin/radiobrowser
sudo cp init/radiobrowser.service /etc/systemd/system
sudo cp static/* /usr/share/radiobrowser/
sudo cp etc/config-example.toml /etc/radiobrowser/config-example.toml
if [ ! -f /etc/radiobrowser/config.toml ]; then
sudo cp etc/config-example.toml /etc/radiobrowser/config.toml
fi
sudo cp etc/logrotate /etc/logrotate.d/radiobrowser
sudo chmod ugo+x /usr/bin/radiobrowser
sudo groupadd --system radiobrowser
sudo useradd --system --no-create-home --home-dir /var/lib/radiobrowser --gid radiobrowser radiobrowser
# Create log dir
sudo mkdir -p /var/log/radiobrowser
sudo chown radiobrowser:radiobrowser /var/log/radiobrowser
# Create home dir
sudo mkdir -p /var/lib/radiobrowser
sudo chown radiobrowser:radiobrowser /var/lib/radiobrowser
sudo systemctl daemon-reload
echo "Enable service with:"
echo " - systemctl enable radiobrowser"
echo "Start service with:"
echo " - systemctl start radiobrowser"
echo "Logs:"
echo " - journalctl -fu radiobrowser"
echo "Edit /etc/radiobrowser/config.toml to according to your needs."