upgrade script for BMC4 minecraft server
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| .pre-commit-config.yaml | ||
| README.md | ||
| upgrade_bmc4.sh | ||
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:
- Stops the Docker container running the BMC4 server
- Creates a backup of the current server data
- Downloads the latest version of the BMC4 modpack
- Extracts and updates the server files (preserving world data)
- Restarts the Docker container
- Cleans up temporary files
Prerequisites
- Docker installed and running
- A running BMC4 Minecraft server in a Docker container
wget,unzip,rsync, andtarutilities 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
-
Make the script executable:
chmod +x upgrade_bmc4.sh -
Run the script:
./upgrade_bmc4.sh
Important Notes
- The script preserves your world data during the upgrade process
- Backups are stored in
$HOME/bmc4_backupswith 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.