#!/usr/bin/env bash

if [ ! -d /data/ssl/letsencrypt ]; then
    echo -e "\t\t\033[1;33m* creating /data/ssl/letsencrypt directory for let's encrypt certificates\033[0m"
    mkdir /data/ssl/letsencrypt
fi

chown -R mail:mail /data/ssl/letsencrypt
chown -R mail:mail /opt/www/.well-known/acme-challenge
chmod 777 /opt/www/.well-known/acme-challenge

cp /VERSION /opt/www/.well-known/acme-challenge/TESTING_TOKEN