Skip to content
install 816 B
Newer Older
Pierre Ozoux's avatar
Pierre Ozoux committed
#!/bin/bash -eux

MYSQL_ROOT_PASSWORD=`tr -dc A-Za-z0-9_ < /dev/urandom | head -c 20 | xargs`

unteem's avatar
unteem committed
var=$(for folder in `ls /data/domains`; do cat /data/domains/$folder/.env | grep SUBNET | cut -d"=" -f2; done | sort | tail -n1)
SUBNET=$(($var +1))

Timothee Gosselin's avatar
Timothee Gosselin committed
echo "MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}" > .env
echo "MYSQL_PASSWORD=${MYSQL_ROOT_PASSWORD}" >> .env
unteem's avatar
unteem committed
echo "SUBNET=${SUBNET}" >> .env
Pierre Ozoux's avatar
Pierre Ozoux committed

cat > mail.config.php <<EOF
Pierre Ozoux's avatar
Pierre Ozoux committed
<?php
\$CONFIG = array (
  'mail_domain' => '${MAIL_DOMAIN}',
  'mail_from_address' => 'noreply.${URL}',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => '${MAIL_HOST}',
  'mail_smtpport' => '${MAIL_PORT}',
  'mail_smtpauth' => 1,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpname' => 'noreply.${URL}@${MAIL_DOMAIN}',
  'mail_smtppassword' => '${MAIL_PASS}',
Pierre Ozoux's avatar
Pierre Ozoux committed
  'mail_smtpsecure' => 'tls',
Pierre Ozoux's avatar
Pierre Ozoux committed
);
EOF