summaryrefslogtreecommitdiffstats
path: root/audio-players/mpd/FINAL
blob: 773d5de05789cf88002e9bf9e8e2038819394d84 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# If the user chose to install init script 
# we do what mpd need to run as a service correctly
if [[ $INIT_INSTALLED ]]; then
     local MPD_LIB="${INSTALL_ROOT}/var/lib/mpd" &&
     local MPD_DIRS="${MPD_LIB}/music ${MPD_LIB}/playlists" &&
     local MPD_FILES="${INSTALL_ROOT}/var/log/mpd.log ${INSTALL_ROOT}/var/log/mpd.error" &&
     for dir in "${MPD_LIB} ${MPD_DIRS}"; do
          if [[ ! -r ${dir} ]]; then
               mkdir -p ${dir}  &&
               chown musicdaemon:audio ${dir}
          fi
     done  &&

     for file in ${MPD_FILES}; do
          if [[ ! -r ${file} ]]; then
               touch ${file} &&
               chown musicdaemon:audio ${file}
          fi
     done
fi