Commit 2ec95ebb authored by Steve Parris's avatar Steve Parris Committed by Steve Parris

main/mariadb: quote variables

Partial fix. Subsequent scripts like 'mysqld_safe' still do not handle whitespaces in filenames properly.
parent 5f9b5f4f
Pipeline #59312 passed with stages
in 1 minute and 19 seconds
......@@ -12,9 +12,9 @@ depend() {
}
start_pre() {
required_dirs=$(getconf datadir "/var/lib/mysql")
required_dirs="$(getconf datadir '/var/lib/mysql')"
if [ ! -d $required_dirs/mysql ]; then
if [ ! -d "$required_dirs/mysql" ]; then
eerror "Datadir '$required_dirs' is empty or invalid."
eerror "Run '/etc/init.d/mariadb setup' to create new database."
fi
......@@ -26,11 +26,11 @@ start_post() {
setup() {
ebegin "Creating a new MySQL database"
mysql_install_db --user=mysql --datadir=$(getconf datadir "/var/lib/mysql")
mysql_install_db --user=mysql --datadir="$(getconf datadir '/var/lib/mysql')"
eend $?
}
getconf() {
v=$(my_print_defaults --mysqld | grep ^--$1)
[ -z $v ] && echo $2 || echo ${v#*=}
[ -z "$v" ] && echo "$2" || echo "${v#*=}"
}
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