scripts/fogcutter/podman/minecraft.sh

34 lines
746 B
Bash
Raw Normal View History

2020-12-26 23:16:52 -05:00
#!/bin/bash
set -e
up () {
2020-12-28 19:38:09 -05:00
loginctl enable-linger $USER
2020-12-26 23:16:52 -05:00
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
2020-12-28 19:38:09 -05:00
podman generate systemd minecraft --restart-policy=always --name > $HOME/.config/systemd/user/minecraft.service
2020-12-26 23:16:52 -05:00
systemctl --user daemon-reload
2020-12-27 03:14:45 -05:00
systemctl start --user minecraft || systemctl restart --user minecraft
2020-12-26 23:16:52 -05:00
systemctl enable --user minecraft
}
down () {
systemctl stop --user minecraft || true
systemctl disable --user minecraft || true
podman rm minecraft || true
}
logs () {
podman logs --follow minecraft
}
$@