Skip to content

Commit 0238305

Browse files
committed
mysql is default type
1 parent a5714c1 commit 0238305

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bin/v-add-database

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22
# info: add database
3-
# options: USER DATABASE DBUSER DBPASS TYPE [HOST] [CHARSET]
3+
# options: USER DATABASE DBUSER DBPASS [TYPE] [HOST] [CHARSET]
44
#
55
# The function creates the database concatenating username and user_db.
6-
# Supported yypes of databases you can get using v-list-sys-config script.
6+
# Supported types of databases you can get using v-list-sys-config script.
77
# If the host isn't stated and there are few hosts configured on the server,
88
# then the host will be defined by one of three algorithms. "First" will choose
99
# the first host in the list. "Random" will chose the host by a chance.
@@ -20,7 +20,7 @@ user=$1
2020
database="$user"_"$2"
2121
dbuser="$user"_"$3"
2222
dbpass=$4
23-
type=$5
23+
type=${5-mysql}
2424
host=$6
2525
charset=${7-UTF8}
2626
charset=$(echo "$charset" |tr '[:lower:]' '[:upper:]')
@@ -40,7 +40,7 @@ EVENT="$EVENT A4='$A4' A5='$A5' A6='$A6' A7='$A7' A8='$A8' A9='$A9'"
4040
# Verifications #
4141
#----------------------------------------------------------#
4242

43-
check_args '5' "$#" 'USER DATABASE DBUSER DBPASS TYPE [HOST] [CHARSET]'
43+
check_args '4' "$#" 'USER DATABASE DBUSER DBPASS [TYPE] [HOST] [CHARSET]'
4444
validate_format 'user' 'database' 'dbuser' 'dbpass' 'charset'
4545
is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
4646
is_type_valid "$DB_SYSTEM" "$type"

0 commit comments

Comments
 (0)