Skip to content

Stuntmonkey4u/ACrebuild

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AzerothCore Rebuild/Update Script

This script is designed to help you update, build, run, and manage your AzerothCore server — a popular server emulator for World of Warcraft. It simplifies common tasks such as updating the source code, managing dependencies, rebuilding the server, handling server processes, managing backups, viewing logs, and configuring operational parameters via an external file.


Features:

  • Dependency Check: Automatically checks for essential software like git, cmake, make, clang, clang++, tmux, nc, etc. If missing, it will prompt you to install them.
  • Source Code Update: Allows you to update your existing AzerothCore server's source code from its Git repository.
  • Rebuilding the Server: Uses cmake and make to rebuild and reinstall the updated AzerothCore server, with an option to specify the number of CPU cores for faster builds.
  • Safety Check: Prompts the user to stop running servers before a rebuild operation to prevent conflicts and ensure a clean build process.
  • Process Management: Advanced control over server processes, including starting, stopping, restarting, and checking the status of authserver and worldserver within their TMUX session.
  • Backup and Restore: Easily backup your server's databases (world, characters, auth) and server configuration files (worldserver.conf, authserver.conf). Restore from existing backups.
  • Log Viewer: View script operation logs, as well as live (tail -f) or static (less) authserver and worldserver logs directly through the script.
  • Module Management: Helps you to update all or individual custom modules located in your modules directory.
  • External Configuration: Persistent settings via an external configuration file (~/.ACrebuild/ACrebuild.conf), making it easy to customize paths, credentials (with caution for passwords), and other operational parameters.
  • Flexible Menu System: Interactive menus guide you through various operations.
  • Self-Update Capability: The script can update itself to the latest version from its Git repository.

Installation

  1. Clone the repository (or download the script) to your local machine:
    git clone https://github.com/Stuntmonkey4u/ACrebuild.git
    cd ACrebuild
    chmod +x ACrebuild.sh
  2. Run the script:
    ./ACrebuild.sh
    The script will guide you through initial setup, including the location of your AzerothCore installation if it's not in the default path (~/azerothcore).

How It Works

When you run ACrebuild.sh, it presents an interactive main menu with several categories:

  • Server Operations: Options to update source code, manage custom modules, and perform server rebuilds (with an option to also run the server post-rebuild). Server starting is also handled under "Process Management".
  • Server Management:
    • Process Management: Control starting, stopping, and restarting authserver and worldserver. Check their status within the TMUX session.
    • Backup/Restore Options: Create new backups of your databases and server configurations, or restore from a previously created backup.
    • Log Viewer: Access and view logs generated by the script itself, authserver, or worldserver.
  • Script Maintenance & Exit:
    • Self-Update ACrebuild Script: If the script was cloned from its Git repository, this option allows it to fetch and apply the latest updates to itself. (New menu option [8])
    • Configuration Options: Manage the script's settings. You can view the current configuration, edit the configuration file directly, or reset all settings to their defaults.
    • Quit Script: Exits the ACrebuild.sh script.

The script uses tmux to run authserver and worldserver in a manageable split-pane session (one window with two panes), allowing you to detach and reattach to view server console output.

Self-Update Process

The script now includes an option to update itself. If you cloned the ACrebuild script from its Git repository (as recommended in the Installation section), you can use the "Self-Update ACrebuild Script" option (currently option [8]) in the main menu. This feature will:

  1. Fetch the latest changes from the origin remote of the script's repository.
  2. Check if your local version is different from the remote version.
  3. If an update is available, it will inform you of the current and new versions.
  4. It will check for any uncommitted local changes in the script's directory. If changes are found, the update will be aborted to prevent conflicts, and you'll be advised to commit or stash your changes.
  5. If there are no local changes, it will ask for confirmation before pulling the updates.
  6. Upon confirmation, it will pull the latest changes.
  7. If the pull is successful, the script will automatically restart itself to apply the updates.

This process ensures you're always running the latest version of the management script without manual intervention, provided the script is a Git clone and has an 'origin' remote.


Configuration

The ACrebuild.sh script uses an external configuration file located at: ~/.ACrebuild/ACrebuild.conf

This file is automatically created with default values when you first run the script or if it's missing. You can manage this configuration through the "Configuration Options" menu within the script.

Key settings you can configure include:

  • AZEROTHCORE_DIR: The path to your AzerothCore installation.
  • BACKUP_DIR: The directory where backups will be stored.
  • DB_USER, DB_PASS (use with caution, leave empty to be prompted), AUTH_DB_NAME, CHAR_DB_NAME, WORLD_DB_NAME: Database connection details for backups and restores.
  • Paths for server configuration and log directories (usually relative to AZEROTHCORE_DIR).
  • Filenames for server and script logs.
  • CORES_FOR_BUILD: Number of CPU cores to use during the make process for faster compilation.

It's recommended to manage these settings via the script's menu, especially for paths, to ensure they are correctly formatted. For sensitive information like DB_PASS, the script will always prompt you if it's empty in the configuration file, which is the recommended approach for security.


License

This script is licensed under the MIT License. Feel free to modify and use it as needed.


Disclaimer

This script is provided as-is, with no warranties or guarantees. Use at your own risk. Make sure to backup your server data before running any script that modifies or updates your environment.


Contributors (So Far...)

Created by Stuntmonkey4u

Pull Request

If you have an improvement or idea, make a pull request, get your name added to the Contributors list!!

About

A user friendly script for rebuilding and running the AzerothCore server

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages