mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
fix(apps/installer): windows setup (#23007)
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Set SUDO variable - one liner
|
# Set SUDO variable - one liner
|
||||||
SUDO=$([ "$EUID" -ne 0 ] && echo "sudo" || echo "")
|
if [[ "$OSTYPE" == "msys"* ]]; then
|
||||||
|
SUDO=""
|
||||||
|
else
|
||||||
|
SUDO=$([ "$EUID" -ne 0 ] && echo "sudo" || echo "")
|
||||||
|
fi
|
||||||
|
|
||||||
function inst_configureOS() {
|
function inst_configureOS() {
|
||||||
echo "Platform: $OSTYPE"
|
echo "Platform: $OSTYPE"
|
||||||
@@ -67,7 +71,7 @@ function inst_dbCreate() {
|
|||||||
# In CI environments or when no password is set, try without password first
|
# In CI environments or when no password is set, try without password first
|
||||||
if [[ "$CONTINUOUS_INTEGRATION" == "true" ]]; then
|
if [[ "$CONTINUOUS_INTEGRATION" == "true" ]]; then
|
||||||
echo "CI environment detected, attempting connection without password..."
|
echo "CI environment detected, attempting connection without password..."
|
||||||
|
|
||||||
if $SUDO mysql -u root < "$AC_PATH_ROOT/data/sql/create/create_mysql.sql" 2>/dev/null; then
|
if $SUDO mysql -u root < "$AC_PATH_ROOT/data/sql/create/create_mysql.sql" 2>/dev/null; then
|
||||||
echo "Database created successfully."
|
echo "Database created successfully."
|
||||||
return 0
|
return 0
|
||||||
@@ -75,7 +79,7 @@ function inst_dbCreate() {
|
|||||||
echo "Failed to connect without password, falling back to interactive mode..."
|
echo "Failed to connect without password, falling back to interactive mode..."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Try with password (interactive mode)
|
# Try with password (interactive mode)
|
||||||
echo "Please enter your sudo and your MySQL root password if prompted."
|
echo "Please enter your sudo and your MySQL root password if prompted."
|
||||||
$SUDO mysql -u root -p < "$AC_PATH_ROOT/data/sql/create/create_mysql.sql"
|
$SUDO mysql -u root -p < "$AC_PATH_ROOT/data/sql/create/create_mysql.sql"
|
||||||
@@ -178,4 +182,4 @@ function inst_download_client_data {
|
|||||||
&& echo "unzip downloaded file in $path..." && unzip -q -o "$zipPath" -d "$path/" \
|
&& echo "unzip downloaded file in $path..." && unzip -q -o "$zipPath" -d "$path/" \
|
||||||
&& echo "Remove downloaded file" && rm "$zipPath" \
|
&& echo "Remove downloaded file" && rm "$zipPath" \
|
||||||
&& echo "INSTALLED_VERSION=$VERSION" > "$dataVersionFile"
|
&& echo "INSTALLED_VERSION=$VERSION" > "$dataVersionFile"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# AzerothCore Dashboard Script
|
# AzerothCore Dashboard Script
|
||||||
#
|
#
|
||||||
# This script provides an interactive menu system for AzerothCore management
|
# This script provides an interactive menu system for AzerothCore management
|
||||||
# using the unified menu system library.
|
# using the unified menu system library.
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./acore.sh - Interactive mode with numeric and text selection
|
# ./acore.sh - Interactive mode with numeric and text selection
|
||||||
# ./acore.sh <command> [args] - Direct command execution (only text commands, no numbers)
|
# ./acore.sh <command> [args] - Direct command execution (only text commands, no numbers)
|
||||||
#
|
#
|
||||||
# Interactive Mode:
|
# Interactive Mode:
|
||||||
# - Select options by number (1, 2, 3...), command name (init, compiler, etc.),
|
# - Select options by number (1, 2, 3...), command name (init, compiler, etc.),
|
||||||
# or short alias (i, c, etc.)
|
# or short alias (i, c, etc.)
|
||||||
# - All selection methods work in interactive mode
|
# - All selection methods work in interactive mode
|
||||||
#
|
#
|
||||||
@@ -35,6 +35,7 @@ menu_items=(
|
|||||||
"install-deps|d|Configure OS dep"
|
"install-deps|d|Configure OS dep"
|
||||||
"pull|u|Update Repository"
|
"pull|u|Update Repository"
|
||||||
"reset|r|Reset & Clean Repository"
|
"reset|r|Reset & Clean Repository"
|
||||||
|
"setup-db|r|Install db only"
|
||||||
"compiler|c|Run compiler tool"
|
"compiler|c|Run compiler tool"
|
||||||
"module|m|Module manager (search/install/update/remove)"
|
"module|m|Module manager (search/install/update/remove)"
|
||||||
"client-data|gd|download client data from github repository (beta)"
|
"client-data|gd|download client data from github repository (beta)"
|
||||||
@@ -51,52 +52,55 @@ menu_items=(
|
|||||||
function handle_menu_command() {
|
function handle_menu_command() {
|
||||||
local key="$1"
|
local key="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
case "$key" in
|
case "$key" in
|
||||||
"init")
|
"init")
|
||||||
inst_allInOne
|
inst_allInOne
|
||||||
;;
|
;;
|
||||||
"install-deps")
|
"install-deps")
|
||||||
inst_configureOS
|
inst_configureOS
|
||||||
;;
|
;;
|
||||||
"pull")
|
"pull")
|
||||||
inst_updateRepo
|
inst_updateRepo
|
||||||
;;
|
;;
|
||||||
"reset")
|
"reset")
|
||||||
inst_resetRepo
|
inst_resetRepo
|
||||||
;;
|
;;
|
||||||
"compiler")
|
"setup-db")
|
||||||
bash "$AC_PATH_APPS/compiler/compiler.sh" "$@"
|
inst_dbCreate
|
||||||
;;
|
;;
|
||||||
"module")
|
"compiler")
|
||||||
bash "$AC_PATH_APPS/installer/includes/modules-manager/module-main.sh" "$@"
|
bash "$AC_PATH_APPS/compiler/compiler.sh" "$@"
|
||||||
;;
|
;;
|
||||||
"client-data")
|
"module")
|
||||||
inst_download_client_data
|
bash "$AC_PATH_APPS/installer/includes/modules-manager/module-main.sh" "$@"
|
||||||
;;
|
;;
|
||||||
"run-worldserver")
|
"client-data")
|
||||||
inst_simple_restarter worldserver
|
inst_download_client_data
|
||||||
;;
|
;;
|
||||||
"run-authserver")
|
"run-worldserver")
|
||||||
inst_simple_restarter authserver
|
inst_simple_restarter worldserver
|
||||||
;;
|
;;
|
||||||
"docker")
|
"run-authserver")
|
||||||
|
inst_simple_restarter authserver
|
||||||
|
;;
|
||||||
|
"docker")
|
||||||
DOCKER=1 bash "$AC_PATH_ROOT/apps/docker/docker-cmd.sh" "$@"
|
DOCKER=1 bash "$AC_PATH_ROOT/apps/docker/docker-cmd.sh" "$@"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
"version")
|
"version")
|
||||||
printf "AzerothCore Rev. %s\n" "$ACORE_VERSION"
|
printf "AzerothCore Rev. %s\n" "$ACORE_VERSION"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
"service-manager")
|
"service-manager")
|
||||||
bash "$AC_PATH_APPS/startup-scripts/src/service-manager.sh" "$@"
|
bash "$AC_PATH_APPS/startup-scripts/src/service-manager.sh" "$@"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
"quit")
|
"quit")
|
||||||
echo "Goodbye!"
|
echo "Goodbye!"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Invalid option. Use --help to see available commands."
|
echo "Invalid option. Use --help to see available commands."
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user