Last active
January 5, 2016 12:29
-
-
Save protosam/c8b6016e7d84c38f8f06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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