-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·31 lines (23 loc) · 706 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
#!/bin/bash
# WARNING: This file should only be executed on the desired target machine
if [[ $EUID -eq 0 ]]; then
echo "Please do not run this script as root"
exit 1
fi
copy() {
echo "$1 -> $2"
sudo cp -r "$1" "$2" || exit 1
}
sudo mkdir -p /usr/bin/radio || exit 1
copy radio-web /usr/bin/radio
copy images/ /usr/bin/radio
copy radio /usr/bin/radio
sed -i "s/PLACEHOLDER/$USER/g" radio.service
copy radio.service /lib/systemd/system
sudo chown -R "$USER":"$USER" /usr/bin/radio
OLD_DIR=$(pwd)
cd /usr/bin/radio/ || exit 1
./radio -c /etc/radio/config.toml files
cd "$OLD_DIR" || exit 1
echo "Installation succeeded"
echo "NOTE: Execute 'sudo systemctl start radio' to start radio"