minecraft bedrock graceful stop

This commit is contained in:
Matthew Tran
2024-09-17 00:31:10 +00:00
parent 7f7367c74d
commit c888f10a52
4 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
FROM ubuntu:24.04
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
WORKDIR /home/ubuntu
+5 -7
View File
@@ -1,16 +1,14 @@
#!/bin/sh
cleanup() {
echo "stop" > cmd
tmux send-keys stop Enter
}
trap 'cleanup' TERM
rm cmd
mkfifo cmd
LD_LIBRARY_PATH=. ./bedrock_server < cmd &
echo "help" > cmd # shell waits for FIFO to be opened for writing before starting program!
rm log
mkfifo log
tmux new -d 'LD_LIBRARY_PATH=. ./bedrock_server > log'
cat log &
wait $! # wait for SIGTERM
wait $! # wait for server to stop
# TODO stop not working