2020-12-26 23:16:52 -05:00
|
|
|
#!/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
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
$@
|