[[$EUID -ne 0]]&&echo"Please run this script as root"&&exit1
#Check if docker is installed and running
docker version &> /dev/null
#[[ $? -ne 0 ]] && echo "Cannot connect to Docker daemon. Please check your configuration." && exit 1
#Check if docker-compose is installed
docker-compose version &> /dev/null
[[$? -ne 0]]&&echo"docker-compose not found. Please check your configuration."&&exit1
# Check if media container is configured
[[$(docker ps -a --filter="name=media"| wc -l) !="2"]]&&echo"Cannot find a media container - please configure one with your media mounted at /media inside the container before running this script (to keep the size down use tianon/true)"&&exit1
[[$( ls -dn $VOLDIR/${SERVICES[$i]}| awk '{print $3}') !=${SERVICEUID[$i]}]]&&echo"Chowning $VOLDIR/${SERVICES[$i]} to user ${SERVICEUID[$i]}"&& chown ${SERVICEUID[$i]}:${SERVICEUID[$i]}$VOLDIR/${SERVICES[$i]}