mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
Bash: Various improvement for compiler and db_assembler
Now db_assembler also creates the users specified in conf.sh files if not exists + Simplified some paths for compilation
This commit is contained in:
@@ -5,10 +5,6 @@ then
|
||||
CCTYPE=${CCTYPE^} # capitalize first letter if it's not yet
|
||||
fi
|
||||
|
||||
BUILDPATH=$BINPATH
|
||||
[ $CTYPE == "Debug" ] && BUILDPATH="$BUILDPATH/debug/" || BUILDPATH="$BUILDPATH/release/"
|
||||
|
||||
INSTALL_PATH=$(readlink -f "$BINPATH/../")
|
||||
|
||||
[ $CTYPE == "Debug" ] && BUILDPATH="$BUILDPATH/debug/build/" || BUILDPATH="$BUILDPATH/release/build/"
|
||||
|
||||
[ $CTYPE == "Debug" ] && BINPATH="$BINPATH/debug" || BINPATH="$BINPATH/release"
|
||||
[ $CTYPE == "Debug" ] && BINPATH="$BINPATH/debug/" || BINPATH="$BINPATH/release/"
|
||||
|
||||
@@ -10,8 +10,7 @@ fi
|
||||
|
||||
function ac_on_after_build() {
|
||||
# move the run engine
|
||||
mkdir -p "$INSTALL_PATH/bin/"
|
||||
cp -rvf "$AC_PATH_MODULES/acore/startup-scripts/"* "$INSTALL_PATH/bin/"
|
||||
cp -rvf "$AC_PATH_MODULES/acore/startup-scripts/"* "$BINPATH"
|
||||
}
|
||||
|
||||
registerHooks "ON_AFTER_BUILD" ac_on_after_build
|
||||
|
||||
@@ -29,6 +29,10 @@ function dbasm_mysqlExec() {
|
||||
read -p "Insert mysql pass:" -s PROMPT_PASS
|
||||
export MYSQL_PWD=$PROMPT_PASS
|
||||
|
||||
# create configured account if not exists
|
||||
"$DB_MYSQL_EXEC" -h "$MYSQL_HOST" -u "$PROMPT_USER" $options -e "CREATE USER '${MYSQL_USER}'@'${MYSQL_HOST}' IDENTIFIED BY '${MYSQL_PASS}' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;"
|
||||
"$DB_MYSQL_EXEC" -h "$MYSQL_HOST" -u "$PROMPT_USER" $options -e "GRANT USAGE ON * . * TO '${MYSQL_USER}'@'${MYSQL_HOST}' WITH GRANT OPTION;"
|
||||
|
||||
retval=$("$DB_MYSQL_EXEC" -h "$MYSQL_HOST" -u "$PROMPT_USER" $options -e "$command")
|
||||
else
|
||||
exit
|
||||
@@ -73,11 +77,15 @@ function dbasm_createDB() {
|
||||
|
||||
eval $confs
|
||||
|
||||
CONF_USER=$MYSQL_USER
|
||||
CONF_PASS=$MYSQL_PASS
|
||||
|
||||
if dbasm_dbExists $dbname "$confs"; then
|
||||
echo "$dbname database exists"
|
||||
else
|
||||
echo "Creating DB ${dbname} ..."
|
||||
dbasm_mysqlExec "$confs" "CREATE DATABASE \`${dbname}\`" ""
|
||||
dbasm_mysqlExec "$confs" "GRANT ALL PRIVILEGES ON \`${dbname}\` . * TO '${CONF_USER}'@'${MYSQL_HOST}' WITH GRANT OPTION;"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user