Skip to content

Instantly share code, notes, and snippets.

@protosam
Last active January 5, 2016 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save protosam/c8b6016e7d84c38f8f06 to your computer and use it in GitHub Desktop.
Save protosam/c8b6016e7d84c38f8f06 to your computer and use it in GitHub Desktop.
#!/bin/bash
ROUNDCUBEPASSWORD=$(openssl rand -base64 12)
mysql -e 'drop database roundcubedb'
mysql -e 'create database roundcubedb'
mysql -e "grant all privileges on roundcubedb.* to roundcubeuser@localhost identified by '$ROUNDCUBEPASSWORD';"
mysql -e 'FLUSH PRIVILEGES'
mysql roundcubedb < /usr/share/roundcubemail/SQL/mysql.initial.sql
sed -i -e "s/\$config\['db_dsnw'\].*/\$config['db_dsnw'] = # 'mysql:\/\/roundcubeuser:$ROUNDCUBEPASSWORD@localhost\/roundcubedb';/g" /etc/roundcubemail/defaults.inc.php
ln -s /etc/roundcubemail/defaults.inc.php /etc/roundcubemail/config.inc.php
sed -i "s/\$config\['create_default_folders'\] = false;/\$config\['create_default_folders'\] = true;/g" /etc/roundcubemail/defaults.inc.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment