1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-06-26 06:33:15 +00:00

fix: merged pull request #25 to devel

This commit is contained in:
jcorporation 2018-07-29 23:10:07 +01:00
parent 02ca72e48b
commit 4d64eebbe8

View File

@ -23,7 +23,7 @@ if [ -f buildtools/closure-stylesheets.jar ]
then then
echo "Minifying stylesheets" echo "Minifying stylesheets"
[ htdocs/css/mpd.css -nt htdocs/css/mpd.min.css ] && \ [ htdocs/css/mpd.css -nt htdocs/css/mpd.min.css ] && \
java -jar buildtools/closure-stylesheets.jar --allow-unrecognized-properties htdocs/css/mpd.css > htdocs/css/mpd.min.css java -jar buildtools/closure-stylesheets.jar htdocs/css/mpd.css > htdocs/css/mpd.min.css
else else
echo "buildtools/closure-stylesheets.jar not found, using non-minified files" echo "buildtools/closure-stylesheets.jar not found, using non-minified files"
[ htdocs/css/mpd.css -nt htdocs/css/mpd.min.css ] && \ [ htdocs/css/mpd.css -nt htdocs/css/mpd.min.css ] && \
@ -44,8 +44,8 @@ sudo sed -i -e 's/mpd\.css/mpd\.min\.css/' -e 's/player\.js/player\.min\.js/' /u
sudo sed -i -e 's/mpd\.css/mpd\.min\.css/' -e 's/mpd\.js/mpd\.min\.js/' -e 's/player\.js/player\.min\.js/' /usr/share/mympd/htdocs/sw.min.js sudo sed -i -e 's/mpd\.css/mpd\.min\.css/' -e 's/mpd\.js/mpd\.min\.js/' -e 's/player\.js/player\.min\.js/' /usr/share/mympd/htdocs/sw.min.js
sudo sed -i -e 's/\/sw\.js/\/sw\.min\.js/' /usr/share/mympd/htdocs/js/mpd.min.js sudo sed -i -e 's/\/sw\.js/\/sw\.min\.js/' /usr/share/mympd/htdocs/js/mpd.min.js
echo "Minifying html" echo "Minifying html"
sudo perl -i -pe 's/^\s*//gm; s/\s*$//gm' /usr/share/mympd/htdocs/index.html perl -i -pe 's/^\s*//gm; s/\s*$//gm' /usr/share/mympd/htdocs/index.html
sudo perl -i -pe 's/^\s*//gm; s/\s*$//gm' /usr/share/mympd/htdocs/player.html perl -i -pe 's/^\s*//gm; s/\s*$//gm' /usr/share/mympd/htdocs/player.html
echo "Fixing ownership of /var/lib/mympd" echo "Fixing ownership of /var/lib/mympd"
sudo chown nobody /var/lib/mympd sudo chown nobody /var/lib/mympd
@ -53,8 +53,8 @@ sudo chown nobody /var/lib/mympd
echo "Trying to link musicdir to library" echo "Trying to link musicdir to library"
if [ -f /etc/mpd.conf ] if [ -f /etc/mpd.conf ]
then then
LIBRARY=$(grep music /etc/mpd.conf | awk {'print $2'}) LIBRARY=$(grep music /etc/mpd.conf | awk {'print $2'} | sed -e 's/"//g')
[ "$LIBRARY" != "" ] && [ ! -e /usr/share/mympd/htdocs/library ] && ln -s $LIBRARY /usr/share/mympd/htdocs/library [ "$LIBRARY" != "" ] && [ ! -e /usr/share/mympd/htdocs/library ] && ln -s "$LIBRARY" /usr/share/mympd/htdocs/library
else else
echo "/etc/mpd.conf not found, you must link your musicdir manually to /usr/share/mympd/htdocs/library" echo "/etc/mpd.conf not found, you must link your musicdir manually to /usr/share/mympd/htdocs/library"
fi fi
@ -65,9 +65,9 @@ then
if [ contrib/mympd.service -nt /etc/systemd/system/mympd.service ] if [ contrib/mympd.service -nt /etc/systemd/system/mympd.service ]
then then
sudo cp -v contrib/mympd.service /etc/systemd/system/ sudo cp -v contrib/mympd.service /etc/systemd/system/
sudo systemctl daemon-reload systemctl daemon-reload
fi fi
sudo systemctl enable mympd systemctl enable mympd
fi fi
if [ -d /etc/mympd/ssl ] if [ -d /etc/mympd/ssl ]
@ -75,7 +75,7 @@ then
echo "Certificates already created" echo "Certificates already created"
else else
echo "Creating certificates" echo "Creating certificates"
sudo contrib/crcert.sh contrib/crcert.sh
fi fi
echo "myMPD installed" echo "myMPD installed"