Skip to content

Commit 6b97f73

Browse files
authored
Determining is it MySQL or MariaDB in mysql_connect() func
1 parent 58c9656 commit 6b97f73

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

func/db.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ mysql_connect() {
3838
exit $E_CONNECT
3939
fi
4040
mysql_ver=$(cat $mysql_out |tail -n1 |cut -f 1 -d -)
41+
mysql_fork="mysql"
42+
check_mysql_fork=$(grep "MariaDB" $mysql_out)
43+
if [ ! -z "$check_mysql_fork" ]; then
44+
mysql_fork="mariadb"
45+
fi
4146
rm -f $mysql_out
4247
}
4348

0 commit comments

Comments
 (0)