forked from MayaPosch/NymphCast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_linux.sh
executable file
·63 lines (52 loc) · 1.77 KB
/
install_linux.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
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
# NymphCast installer for the Linux platform.
if [ "$(uname -s)" = "Linux" ]; then
echo "Detected Linux system. Proceeding with installation..."
else
echo "This installer requires a Linux system. Exiting..."
exit
fi
# Requires that the binaries have been compiled with the 'setup.sh' script first.
PLATFORM=`g++ -dumpmachine`
if [ -f "src/server/bin/${PLATFORM}/nymphcast_server" ]; then
echo "NymphCast Server binary found, skipping compilation..."
else
echo "Compiling NymphCast server..."
./setup.sh
fi
# Copy files to the target folders.
sudo make -C src/server/ install
# Install systemd or openrc service.
if [ -d "/run/systemd/system" ]; then
echo "Installing systemd service..."
sudo make -C src/server/ install-systemd
sudo chmod 644 /etc/systemd/user/nymphcast.service
#sudo systemctl enable nymphcast.service
systemctl --user enable nymphcast.service
else
echo "Installing OpenRC service..."
sudo make -C src/server/ install-openrc
fi
# Set the requested configuration file.
read -p "Desired NymphCast receiver configuration? [audio/video/screensaver/gui] " choice
case $choice in
audio)
echo "Setting Audio configuration..."
sudo cp src/server/nymphcast_audio_config.ini /usr/local/etc/nymphcast/nymphcast_config.ini
;;
video)
echo "Setting video configuration..."
sudo cp src/server/nymphcast_video_config.ini /usr/local/etc/nymphcast/nymphcast_config.ini
;;
screensaver)
echo "Setting screensaver configuration..."
sudo cp src/server/nymphcast_screensaver_config.ini /usr/local/etc/nymphcast/nymphcast_config.ini
;;
gui)
echo "Setting GUI configuration..."
sudo cp src/server/nymphcast_gui_config.ini /usr/local/etc/nymphcast/nymphcast_config.ini
;;
*)
echo "Unrecognised choice. Please set configuration manually."
;;
esac