Browse Source

Added ViMbAdmin password/host change from postfix configuration

old-stable
gau1991 11 years ago
parent
commit
fcc188a46f
  1. 17
      src/vendor/ee_ven_setup_vimbadmin.sh

17
src/vendor/ee_ven_setup_vimbadmin.sh

@ -10,8 +10,8 @@ function ee_mod_setup_vimbadmin()
|| ee_lib_error "Unable to create ViMbAdmin database, exit status = " $? || ee_lib_error "Unable to create ViMbAdmin database, exit status = " $?
# Create MySQL User # Create MySQL User
mysql -e "create user 'vimbadmin'@'$EE_MYSQL_HOST' identified by '$ee_random'" \ mysql -e "grant all privileges on vimbadmin.* to vimbadmin@'$EE_MYSQL_HOST' IDENTIFIED BY '$ee_random'" \
|| ee_lib_error "Unable to create ViMbAdmin database user, exit status = " $? || ee_lib_error "Unable to grant privileges for ViMbAdmin database user, exit status = " $?
mysql -e "flush privileges" mysql -e "flush privileges"
# Setup configuration for ViMbAdmin # Setup configuration for ViMbAdmin
@ -26,4 +26,17 @@ function ee_mod_setup_vimbadmin()
sed -i "s/resources.doctrine2.connection.options.host = 'localhost'/resources.doctrine2.connection.options.host = '$EE_MYSQL_HOST'/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini sed -i "s/resources.doctrine2.connection.options.host = 'localhost'/resources.doctrine2.connection.options.host = '$EE_MYSQL_HOST'/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini
sed -i "s/defaults.mailbox.password_scheme = \"md5.salted\"/defaults.mailbox.password_scheme = \"md5\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini sed -i "s/defaults.mailbox.password_scheme = \"md5.salted\"/defaults.mailbox.password_scheme = \"md5\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini
# Changing hosts and password of ViMbAdmin database in postfix configuration
sed -i "s/password = password/password = $ee_random" /etc/postfix/mysql/virtual_alias_maps.cf
sed -i "s/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST" /etc/postfix/mysql/virtual_alias_maps.cf
sed -i "s/password = password/password = $ee_random" /etc/postfix/mysql/virtual_domains_maps.cf
sed -i "s/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST" /etc/postfix/mysql/virtual_domains_maps.cf
sed -i "s/password = password/password = $ee_random" /etc/postfix/mysql/virtual_mailbox_maps.cf
sed -i "s/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST" /etc/postfix/mysql/virtual_mailbox_maps.cf
sed -i "s/password=password/password=$ee_random" /etc/dovecot/dovecot-sql.conf.ext
sed -i "s/hosts=localhost/hosts=$EE_MYSQL_HOST" /etc/dovecot/dovecot-sql.conf.ext
}

Loading…
Cancel
Save