File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 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
2020database=" $user " _" $2 "
2121dbuser=" $user " _" $3 "
2222dbpass=$4
23- type=$5
23+ type=${5-mysql}
2424host=$6
2525charset=${7-UTF8}
2626charset=$( 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]'
4444validate_format ' user' ' database' ' dbuser' ' dbpass' ' charset'
4545is_system_enabled " $DB_SYSTEM " ' DB_SYSTEM'
4646is_type_valid " $DB_SYSTEM " " $type "
You can’t perform that action at this time.
0 commit comments