mirror of
https://github.com/dragonlock2/matthewtran.com.git
synced 2025-10-11 20:17:54 +00:00
minecraft bedrock graceful stop
This commit is contained in:
parent
7f7367c74d
commit
c888f10a52
@ -6,8 +6,9 @@ RUN apt-get install -y wget openjdk-21-jre
|
|||||||
USER ubuntu
|
USER ubuntu
|
||||||
WORKDIR /home/ubuntu
|
WORKDIR /home/ubuntu
|
||||||
|
|
||||||
RUN wget https://github.com/Tiiffi/mcrcon/releases/download/v0.7.2/mcrcon-0.7.2-linux-x86-64.tar.gz
|
# from https://github.com/itzg/rcon-cli
|
||||||
RUN tar xvf mcrcon-0.7.2-linux-x86-64.tar.gz
|
RUN wget -O rcon-cli.tar.gz https://github.com/itzg/rcon-cli/releases/download/1.6.9/rcon-cli_1.6.9_linux_amd64.tar.gz
|
||||||
|
RUN tar xvf rcon-cli.tar.gz && rm rcon-cli.tar.gz
|
||||||
|
|
||||||
# from https://www.minecraft.net/en-us/download/server (currently 1.21)
|
# from https://www.minecraft.net/en-us/download/server (currently 1.21)
|
||||||
RUN wget https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar
|
RUN wget https://piston-data.mojang.com/v1/objects/59353fb40c36d304f2035d51e7d6e6baa98dc05c/server.jar
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
./mcrcon -p password stop
|
./rcon-cli --password password stop
|
||||||
}
|
}
|
||||||
|
|
||||||
trap 'cleanup' TERM
|
trap 'cleanup' TERM
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
FROM ubuntu:24.04
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
RUN apt-get update && apt-get -y upgrade
|
RUN apt-get update && apt-get -y upgrade
|
||||||
RUN apt-get install -y wget unzip curl
|
RUN apt-get install -y wget unzip curl tmux
|
||||||
|
|
||||||
USER ubuntu
|
USER ubuntu
|
||||||
WORKDIR /home/ubuntu
|
WORKDIR /home/ubuntu
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
echo "stop" > cmd
|
tmux send-keys stop Enter
|
||||||
}
|
}
|
||||||
|
|
||||||
trap 'cleanup' TERM
|
trap 'cleanup' TERM
|
||||||
|
|
||||||
rm cmd
|
rm log
|
||||||
mkfifo cmd
|
mkfifo log
|
||||||
LD_LIBRARY_PATH=. ./bedrock_server < cmd &
|
tmux new -d 'LD_LIBRARY_PATH=. ./bedrock_server > log'
|
||||||
echo "help" > cmd # shell waits for FIFO to be opened for writing before starting program!
|
cat log &
|
||||||
wait $! # wait for SIGTERM
|
wait $! # wait for SIGTERM
|
||||||
wait $! # wait for server to stop
|
wait $! # wait for server to stop
|
||||||
|
|
||||||
# TODO stop not working
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user