From e032c925dbd720c358ba531b820b6ec44c2386a8 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Mon, 19 Dec 2022 22:29:36 +0100 Subject: [PATCH] mysql - add status and refactor setup step --- seqs/mysql.sh | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/seqs/mysql.sh b/seqs/mysql.sh index 25d120f..d88df4a 100755 --- a/seqs/mysql.sh +++ b/seqs/mysql.sh @@ -9,25 +9,38 @@ dbUser= dbRemote=localhost dbPass= -step_1_info() { +step_1_info() { echo "Status"; } +step_1_alias() { echo "status"; } +step_1() { + exe apt policy mariadb-server +} + +step_5_info() { echo "Setup ubuntu $databaseName repository"; } +step_5_alias() { echo "setup"; } +step_5() { + exe apt install curl + exep "curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --skip-maxscale --skip-tools" +} + +step_6_info() { echo "Installation of ${databaseName} packages:" echoinfo "$databasePackages" - echoinfo "(Consider step \"latest\" first to setup official repository with the latest version)" + echoinfo "(Consider step \"setup\" first)" } -step_1_alias() { echo install; } -step_1() { +step_6_alias() { echo install; } +step_6() { exe apt update exe apt install $databasePackages endReturn -o $? "Error instaling $databaseName" } -step_2_info() { echo "Secure ${databaseName} installation"; } -step_2() { +step_7_info() { echo "Secure ${databaseName} installation"; } +step_7() { exe mysql_secure_installation } -step_3_info() { echo "${databaseName} configuration"; } -step_3() { +step_8_info() { echo "${databaseName} configuration"; } +step_8() { addConf -c "$mariadbConfig" "$mariadbConfigLoc" echo -n "Restarting mysql ... " @@ -46,13 +59,6 @@ table_definition_cache=1400 #innodb_force_recovery=6" -step_8_info() { echo "Setup ubuntu $databaseName repository"; } -step_8_alias() { echo "latest"; } -step_8() { - exe apt install curl - exep "curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --skip-maxscale --skip-tools" -} - step_10_info() { echo "Create mysql database without specific characterset" echoinfo " [OPTIONS]"