1
0
mirror of https://github.com/SuperBFG7/ympd synced 2025-11-03 15:22:59 +00:00

Fix: improved package building

This commit is contained in:
jcorporation
2018-09-04 21:36:04 +02:00
parent 83ad164521
commit d799fe1e87
3 changed files with 11 additions and 7 deletions

View File

@@ -55,18 +55,19 @@ sudo chown nobody /var/lib/mympd
echo "Trying to link musicdir to library"
if [ -f /etc/mpd.conf ]
then
LIBRARY=$(grep ^music_directory /etc/mpd.conf | awk {'print $2'} | sed -e 's/"//g')
LIBRARY=$(sudo grep ^music_directory /etc/mpd.conf | awk {'print $2'} | sed -e 's/"//g')
[ "$LIBRARY" != "" ] && [ ! -e /usr/share/mympd/htdocs/library ] && sudo ln -s "$LIBRARY" /usr/share/mympd/htdocs/library
else
echo "/etc/mpd.conf not found, you must link your music_directory manually to /usr/share/mympd/htdocs/library"
fi
echo "Installing systemd service"
if [ -d /etc/systemd/system ]
if [ -d /usr/lib/systemd/ ]
then
if [ contrib/mympd.service -nt /etc/systemd/system/mympd.service ]
[ -d /usr/lib/systemd/system ] || sudo mkdir /usr/lib/systemd/system
if [ contrib/mympd.service -nt /usr/lib/systemd/system/mympd.service ]
then
sudo cp contrib/mympd.service /etc/systemd/system/
sudo cp contrib/mympd.service /usr/lib/systemd/system/
sudo systemctl daemon-reload
fi
sudo systemctl enable mympd