diff options
| author | Sho Sakuma <me@m1sk9.dev> | 2026-01-05 22:13:27 +0900 |
|---|---|---|
| committer | Sho Sakuma <me@m1sk9.dev> | 2026-01-05 22:13:27 +0900 |
| commit | 4fe9e26641990f0696ee1841b8e8577ed1eefe55 (patch) | |
| tree | 258cff5e0554d758c26992bbc77aa1956411919f /x | |
| download | LunaticChat-4fe9e26641990f0696ee1841b8e8577ed1eefe55.tar.gz LunaticChat-4fe9e26641990f0696ee1841b8e8577ed1eefe55.tar.bz2 LunaticChat-4fe9e26641990f0696ee1841b8e8577ed1eefe55.zip | |
first commit
Diffstat (limited to 'x')
| -rwxr-xr-x | x | 52 |
1 files changed, 52 insertions, 0 deletions
@@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +set -e + +DOCKER_COMPOSE="docker compose -f docker/compose.yml" + +help() { + cat <<EOF +Usage: ./x <command> + +Commands: + start Build with gradlew and start docker compose + restart Restart minecraft container + stop Stop docker compose + clean Stop docker compose and remove volumes + rcon Open rcon-cli for minecraft container + logs Show minecraft container logs + help Show this help message + +EOF +} + +case "${1:-}" in + start) + ./gradlew shadowJar + $DOCKER_COMPOSE up + ;; + restart) + $DOCKER_COMPOSE restart minecraft + ;; + stop) + $DOCKER_COMPOSE down + ;; + clean) + $DOCKER_COMPOSE down -v + ;; + rcon) + $DOCKER_COMPOSE exec minecraft rcon-cli + ;; + logs) + $DOCKER_COMPOSE logs -f minecraft + ;; + help|"") + help + ;; + *) + echo "Unknown command: $1" + echo "" + help + exit 1 + ;; +esac |
