Commit ad8aaeb2 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Renamed MySQL to MariaDB in CWMP configuration to avoid clash with MySQL connection config

parent 8ba49413
......@@ -8,24 +8,24 @@
# Entry point functuons #
#############################
prefix_list="$prefix_list $DMROOT.MySQL."
entry_execute_method_list="$entry_execute_method_list entry_execute_method_root_MySQL"
entry_execute_method_list_forcedinform="$entry_execute_method_list_forcedinform entry_execute_method_root_MySQL"
entry_execute_method_root_MySQL() {
case "$1" in ""|"$DMROOT."|"$DMROOT.MySQL."*)
common_execute_method_obj "$DMROOT.MySQL." "0"
common_execute_method_param "$DMROOT.MySQL.RootPassword" "1" "" "mysql_set_root_password"
common_execute_method_param "$DMROOT.MySQL.SafeToBootstrap" "1" "mysql_get_safe_to_bootstrap" "mysql_set_safe_to_bootstrap" "xsd:boolean"
common_execute_method_param "$DMROOT.MySQL.GaleraBootstrap" "1" "" "mysql_galera_bootstrap" "xsd:boolean"
common_execute_method_param "$DMROOT.MySQL.GaleraClusterAddress" "1" "mysql_get_cluster_address" "mysql_set_cluster_address"
common_execute_method_param "$DMROOT.MySQL.GaleraClusterOptions" "1" "mysql_get_cluster_options" "mysql_set_cluster_options"
common_execute_method_param "$DMROOT.MySQL.GaleraNodeAddress" "1" "mysql_get_node_address" "mysql_set_node_address"
common_execute_method_param "$DMROOT.MySQL.ServerID" "1" "mysql_get_server_id" "mysql_set_server_id"
common_execute_method_param "$DMROOT.MySQL.WSREPGTIDdomainID" "1" "mysql_get_wsrep_gtid_domain_id" "mysql_set_wsrep_gtid_domain_id"
common_execute_method_param "$DMROOT.MySQL.GTIDdomainID" "1" "mysql_get_gtid_domain_id" "mysql_set_gtid_domain_id"
common_execute_method_param "$DMROOT.MySQL.BinLogDoDB" "1" "mysql_get_binlog_do_db" "mysql_set_binlog_do_db"
common_execute_method_param "$DMROOT.MySQL.BinLogIgnoreDB" "1" "mysql_get_binlog_ignore_db" "mysql_set_binlog_ignore_db"
prefix_list="$prefix_list $DMROOT.MariaDB."
entry_execute_method_list="$entry_execute_method_list entry_execute_method_root_MariaDB"
entry_execute_method_list_forcedinform="$entry_execute_method_list_forcedinform entry_execute_method_root_MariaDB"
entry_execute_method_root_MariaDB() {
case "$1" in ""|"$DMROOT."|"$DMROOT.MariaDB."*)
common_execute_method_obj "$DMROOT.MariaDB." "0"
common_execute_method_param "$DMROOT.MariaDB.RootPassword" "1" "" "mariadb_set_root_password"
common_execute_method_param "$DMROOT.MariaDB.SafeToBootstrap" "1" "mariadb_get_safe_to_bootstrap" "mariadb_set_safe_to_bootstrap" "xsd:boolean"
common_execute_method_param "$DMROOT.MariaDB.GaleraBootstrap" "1" "" "mariadb_galera_bootstrap" "xsd:boolean"
common_execute_method_param "$DMROOT.MariaDB.GaleraClusterAddress" "1" "mariadb_get_cluster_address" "mariadb_set_cluster_address"
common_execute_method_param "$DMROOT.MariaDB.GaleraClusterOptions" "1" "mariadb_get_cluster_options" "mariadb_set_cluster_options"
common_execute_method_param "$DMROOT.MariaDB.GaleraNodeAddress" "1" "mariadb_get_node_address" "mariadb_set_node_address"
common_execute_method_param "$DMROOT.MariaDB.ServerID" "1" "mariadb_get_server_id" "mariadb_set_server_id"
common_execute_method_param "$DMROOT.MariaDB.WSREPGTIDdomainID" "1" "mariadb_get_wsrep_gtid_domain_id" "mariadb_set_wsrep_gtid_domain_id"
common_execute_method_param "$DMROOT.MariaDB.GTIDdomainID" "1" "mariadb_get_gtid_domain_id" "mariadb_set_gtid_domain_id"
common_execute_method_param "$DMROOT.MariaDB.BinLogDoDB" "1" "mariadb_get_binlog_do_db" "mariadb_set_binlog_do_db"
common_execute_method_param "$DMROOT.MariaDB.BinLogIgnoreDB" "1" "mariadb_get_binlog_ignore_db" "mariadb_set_binlog_ignore_db"
return 0;
;;
esac
......@@ -36,12 +36,12 @@ entry_execute_method_root_MySQL() {
# Data model parameters functions #
#######################################
mysql_set_root_password() {
mariadb_set_root_password() {
local pass="$1"
echo "GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY '$pass' WITH GRANT OPTION" | mysql
}
mysql_get_safe_to_bootstrap() {
mariadb_get_safe_to_bootstrap() {
if [ -f /var/lib/mysql/grastate.dat ]; then
local safe=`grep -c 'safe_to_bootstrap: 1' /var/lib/mysql/grastate.dat`
if [ $safe = 1 ]; then
......@@ -55,7 +55,7 @@ mysql_get_safe_to_bootstrap() {
return 0
}
mysql_set_safe_to_bootstrap() {
mariadb_set_safe_to_bootstrap() {
if [ -f /var/lib/mysql/grastate.dat ]; then
if [ $1 = "true" ]; then
sed -i 's/^safe_to_bootstrap: ./safe_to_bootstrap: 1/' /var/lib/mysql/grastate.dat
......@@ -65,7 +65,7 @@ mysql_set_safe_to_bootstrap() {
fi
}
mysql_galera_bootstrap() {
mariadb_galera_bootstrap() {
local safe=`mysql_get_safe_to_bootstrap`
if [ $safe = "true" ]; then
systemctl stop mariadb
......@@ -75,11 +75,11 @@ mysql_galera_bootstrap() {
return 0
}
mysql_get_cluster_address() {
mariadb_get_cluster_address() {
echo `$UCI_GET mariadb.galera.cluster_address`
}
mysql_set_cluster_address() {
mariadb_set_cluster_address() {
local address=`$UCI_GET mariadb.galera.cluster_address`
if [ "$address" != "$1" ]; then
$UCI_SET mariadb.galera.cluster_address="$1"
......@@ -89,11 +89,11 @@ mysql_set_cluster_address() {
fi
}
mysql_get_cluster_options() {
mariadb_get_cluster_options() {
echo `$UCI_GET mariadb.galera.cluster_options`
}
mysql_set_cluster_options() {
mariadb_set_cluster_options() {
local options=`$UCI_GET mariadb.galera.cluster_options`
if [ "$options" != "$1" ]; then
$UCI_SET mariadb.galera.cluster_options="$1"
......@@ -103,11 +103,11 @@ mysql_set_cluster_options() {
fi
}
mysql_get_node_address() {
mariadb_get_node_address() {
echo `$UCI_GET mariadb.galera.node_address`
}
mysql_set_node_address() {
mariadb_set_node_address() {
local address=`$UCI_GET mariadb.galera.node_address`
if [ "$address" != "$1" ]; then
$UCI_SET mariadb.galera.node_address="$1"
......@@ -117,11 +117,11 @@ mysql_set_node_address() {
fi
}
mysql_get_server_id() {
mariadb_get_server_id() {
echo `$UCI_GET mariadb.galera.server_id`
}
mysql_set_server_id() {
mariadb_set_server_id() {
local server_id=`$UCI_GET mariadb.galera.server_id`
if [ "$server_id" != "$1" ]; then
$UCI_SET mariadb.galera.server_id="$1"
......@@ -131,11 +131,11 @@ mysql_set_server_id() {
fi
}
mysql_get_wsrep_gtid_domain_id() {
mariadb_get_wsrep_gtid_domain_id() {
echo `$UCI_GET mariadb.galera.wsrep_gtid_domain_id`
}
mysql_set_wsrep_gtid_domain_id() {
mariadb_set_wsrep_gtid_domain_id() {
local wsrep_gtid_domain_id=`$UCI_GET mariadb.galera.wsrep_gtid_domain_id`
if [ "$wsrep_gtid_domain_id" != "$1" ]; then
$UCI_SET mariadb.galera.wsrep_gtid_domain_id="$1"
......@@ -145,11 +145,11 @@ mysql_set_wsrep_gtid_domain_id() {
fi
}
mysql_get_gtid_domain_id() {
mariadb_get_gtid_domain_id() {
echo `$UCI_GET mariadb.galera.gtid_domain_id`
}
mysql_set_gtid_domain_id() {
mariadb_set_gtid_domain_id() {
local gtid_domain_id=`$UCI_GET mariadb.galera.gtid_domain_id`
if [ "$gtid_domain_id" != "$1" ]; then
$UCI_SET mariadb.galera.gtid_domain_id="$1"
......@@ -159,11 +159,11 @@ mysql_set_gtid_domain_id() {
fi
}
mysql_get_binlog_do_db() {
mariadb_get_binlog_do_db() {
echo `$UCI_GET mariadb.binlog.do_db`
}
mysql_set_binlog_do_db() {
mariadb_set_binlog_do_db() {
local binlog_do_db=`$UCI_GET mariadb.binlog.do_db`
if [ "$binlog_do_db" != "$1" ]; then
$UCI_SET mariadb.binlog.do_db="$1"
......@@ -173,11 +173,11 @@ mysql_set_binlog_do_db() {
fi
}
mysql_get_binlog_ignore_db() {
mariadb_get_binlog_ignore_db() {
echo `$UCI_GET mariadb.binlog.ignore_db`
}
mysql_set_binlog_ignore_db() {
mariadb_set_binlog_ignore_db() {
local binlog_ignore_db=`$UCI_GET mariadb.binlog.ignore_db`
if [ "$binlog_ignore_db" != "$1" ]; then
$UCI_SET mariadb.binlog.ignore_db="$1"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment