#!/usr/bin/with-contenv bash

echo "-------------------------------------"
echo -e "Verifying multi-scrobbler directory permissions based on CONFIG_DIR env: ${CONFIG_DIR} and DATA_DIR env: ${DATA_DIR}\n"

if [ -d "${CONFIG_DIR}" ]; then
  echo "chown'ing config directory to ensure correct permissions."
  chown -R abc:abc "${CONFIG_DIR}"
  echo "Done!"
fi

if [ -d "${DATA_DIR}" ]; then
  echo "chown'ing data directory to ensure correct permissions."
  chown -R abc:abc "${DATA_DIR}"
  echo "Done!"
fi

echo "Done!"
echo -e "-------------------------------------\n"
