# 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
