scripts/fogcutter/podman/minecraft.sh

34 lines
741 B
Bash
Executable File

#!/bin/bash
set -e
up () {
loginctl enable-linger paul
podman create \
--name minecraft \
--env EULA=TRUE \
--env MAX_MEMORY=8G \
--env VERSION=1.15.2 \
--volume /bigdata/k8s-config/minecraft/data:/data:rw \
--publish 127.0.0.1:25565:25565 \
itzg/minecraft-server:latest
podman generate systemd minecraft --restart-policy=always --name > ~/.config/systemd/user/minecraft.service
systemctl --user daemon-reload
systemctl start --user minecraft || systemctl restart --user minecraft
systemctl enable --user minecraft
}
down () {
systemctl stop --user minecraft || true
systemctl disable --user minecraft || true
podman rm minecraft || true
}
logs () {
podman logs --follow minecraft
}
$@