summaryrefslogblamecommitdiffstats
path: root/satellit_installer/includes/40-patch_mysql_config.inc
blob: adc6164f7f046337fb2ba2d6484ad89f0b413118 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                                                  
# This is a _very_ simple mysql config patcher

patch_mysql_config() {
	echo -n "# Patching utf8 entries into /etc/mysql/my.cnf..."
	cp -p /etc/mysql/my.cnf /etc/mysql/my.cnf.$(date +%Y%m%d%H%M%S)
	if [ $(grep -c '# openslx patch marker #' /etc/mysql/my.cnf) -eq 0 ]; then
		sed -i 's/\[client\]/\[client\]\ndefault-character-set = utf8/g' /etc/mysql/my.cnf
		sed -i 's/\[mysql\]/\[mysql\]\ndefault-character-set = utf8/g' /etc/mysql/my.cnf
		sed -i 's/\[mysqld\]/\[mysqld\]\ndefault-character-set = utf8/g' /etc/mysql/my.cnf
		echo '# openslx patch marker #' >> /etc/mysql/my.cnf
		echo " ok."
	else
		echo " already patched."
	fi


}