1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/weblate_ynh.git synced 2024-10-01 13:35:04 +02:00

Add dirinclude for conf.d if not existing in mysql/my.cfg

This commit is contained in:
Jean-Baptiste Holcroft 2017-09-18 12:18:21 +02:00
parent da39602afe
commit 932f08b904
2 changed files with 10 additions and 0 deletions

View file

@ -1,4 +1,5 @@
[mysqld] [mysqld]
sql-mode=STRICT_TRANS_TABLES
innodb_large_prefix=on innodb_large_prefix=on
innodb_file_format=barracuda innodb_file_format=barracuda
innodb_file_per_table=on innodb_file_per_table=on

View file

@ -90,6 +90,15 @@ ynh_mysql_setup_db $db_name $db_name
ynh_mysql_execute_as_root "ALTER DATABASE $db_name CHARACTER SET utf8mb4;" ynh_mysql_execute_as_root "ALTER DATABASE $db_name CHARACTER SET utf8mb4;"
cp ../conf/weblate.cnf /etc/mysql/conf.d/$app.cnf cp ../conf/weblate.cnf /etc/mysql/conf.d/$app.cnf
searchString="!includedir /etc/mysql/conf.d/"
if grep -Fxq "$searchString" /etc/mysql/my.cnf
then
echo "MySQL alread includes conf.d files"
else
echo "MySQL do not includes conf.d files, edditing /etc/mysql/my.cnf"
echo "$searchString" >> /etc/mysql/my.cnf
fi
systemctl restart mysql systemctl restart mysql
#================================================= #=================================================