File: bug-203435-mysql-creatdb.sh.diff

package info (click to toggle)
wwwconfig-common 0.3.0
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 488 kB
  • sloc: sh: 952; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 1,436 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- mysql-createdb.sh	2003-08-15 21:56:14.000000000 +0200
+++ /usr/share/wwwconfig-common/mysql-createdb.sh	2003-08-19 23:51:13.000000000 +0200
@@ -35,19 +35,19 @@
 elif [ ! -x $(which mysql) ] ; then
     error="No mysql client to execute, install the mysql client package and
     run 'dpkg-reconfigure -plow packagename'."
-elif ! $mysqlcmd -f mysql -e "show tables;" >/dev/null 2>&1 ; then
+elif ! eval $mysqlcmd -f mysql -e "\"show tables;\"" >/dev/null 2>&1 ; then
     error="Error when trying to connect to the mysql database.
     This error can occur if you have no database to connect to, or
     if the password was incorrect.
 	use: dpkg-reconfigure -plow packagename to reconfigure."
 else
-    if $mysqlcmd -f -B -e "show databases;" | grep -e "^$dbname$" > /dev/null 2>&1 ; then
+    if eval $mysqlcmd -f -B -e "\"show databases;\"" | grep -e "^$dbname$" > /dev/null 2>&1 ; then
 	log="${log}Database $dbname already exists."
 	status=nothing
     else
 	log="${log}Creating database $dbname."
-	if $mysqlcmd -f -e "CREATE DATABASE $dbname;" ; then
-	    if ! $mysqlcmd -f -B -e "show databases;" | grep -e "^$dbname$" > /dev/null 2>&1 ; then
+	if eval $mysqlcmd -f -e "\"CREATE DATABASE $dbname;\"" ; then
+	    if ! eval $mysqlcmd -f -B -e "\"show databases;\"" | grep -e "^$dbname$" > /dev/null 2>&1 ; then
 		error="Database $dbname NOT successfully created. You have to do it manually."
 	    else
 		status=create