upgrade script for BMC4 minecraft server
Find a file
hermes 1e0b2fd6e4
Some checks failed
CI / shellcheck (push) Failing after 1m6s
ci: re-run via runner pickup verification
2026-09-26 20:07:03 -07:00
.forgejo/workflows fix(ci): self-contained workflow — drop unreachable JS actions 2026-09-16 08:55:27 -07:00
.pre-commit-config.yaml Add basic pre-commit hooks config 2026-06-03 20:45:31 -07:00
README.md Initial commit: Add BMC4 upgrade script and README 2026-01-13 20:04:07 -08:00
upgrade_bmc4.sh Initial commit: Add BMC4 upgrade script and README 2026-01-13 20:04:07 -08:00

BMC4 Minecraft Server Upgrade Script

This repository contains a script to automate the upgrade process for a Better MC Forge BMC4 Minecraft server running in a Docker container.

Overview

The upgrade_bmc4.sh script performs the following operations:

  1. Stops the Docker container running the BMC4 server
  2. Creates a backup of the current server data
  3. Downloads the latest version of the BMC4 modpack
  4. Extracts and updates the server files (preserving world data)
  5. Restarts the Docker container
  6. Cleans up temporary files

Prerequisites

  • Docker installed and running
  • A running BMC4 Minecraft server in a Docker container
  • wget, unzip, rsync, and tar utilities installed
  • Sufficient disk space for backups

Configuration

Before running the script, ensure the following variables in the script are correctly set:

  • SERVER_DIR: Directory where your BMC4 server files are located (default: $HOME/bmc4)
  • DOCKER_CONTAINER_NAME: Name of your Docker container (default: bmc4-server)
  • DOWNLOAD_URL: URL to download the latest BMC4 modpack (currently hardcoded)

Usage

  1. Make the script executable:

    chmod +x upgrade_bmc4.sh
    
  2. Run the script:

    ./upgrade_bmc4.sh
    

Important Notes

  • The script preserves your world data during the upgrade process
  • Backups are stored in $HOME/bmc4_backups with timestamped filenames
  • The script will stop the server during the upgrade process
  • Ensure you have appropriate permissions to stop/start Docker containers
  • The download URL is currently hardcoded and may need updating when a new version is released

Error Handling

The script includes error checking at each major step. If any step fails, the script will log the error and exit with a non-zero status code.

Backup Strategy

The script creates a compressed backup of your server directory before performing the upgrade. These backups are stored in the $BACKUP_DIR and named with timestamps for easy identification.

License

This script is provided as-is without warranty. Use at your own risk.