mirror of
https://github.com/dragonlock2/matthewtran.com.git
synced 2026-06-28 01:58:34 +00:00
minecraft bedrock graceful stop
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user