removed "" characters from mpd library path

grep music /etc/mpd.conf | awk {'print $2'} 

has an output of:

"/path/to/mpd/library"

"" characters have as a result a wrong symlinking when the command below is executed:

 ln -s $LIBRARY /usr/share/mympd/htdocs/library


sed -e 's/"//g' removes " character from $LIBRARY.
This commit is contained in:
Mike Andonov 2018-07-26 09:09:45 +03:00 committed by GitHub
parent 595e41f4b3
commit 1097d42197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ sudo chown nobody /var/lib/mympd
echo "Trying to link musicdir to library"
if [ -f /etc/mpd.conf ]
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
else
echo "/etc/mpd.conf not found, you must link your musicdir manually to /usr/share/mympd/htdocs/library"