mirror of
https://github.com/Frail7487Real/laughing-spork.git
synced 2024-11-14 10:55:10 -05:00
make the server stop countdown show the message every 10 seconds
This commit is contained in:
parent
858519b2f2
commit
f4ba59aa9b
1 changed files with 10 additions and 2 deletions
12
loop.sh
12
loop.sh
|
@ -107,9 +107,17 @@ check() {
|
||||||
|
|
||||||
cd /mnt/globalData/minecraft
|
cd /mnt/globalData/minecraft
|
||||||
|
|
||||||
docker compose exec minecraft rcon-cli broadcast The server is stopping in 30 seconds. Please leave the server.
|
timeLeft=30
|
||||||
|
|
||||||
sleep 30
|
while [ $timeLeft -gt 0 ]; do
|
||||||
|
if [ $(($timeLeft % 10)) -eq 0 ]; then
|
||||||
|
docker compose exec minecraft rcon-cli broadcast The server is stopping in $timeLeft seconds. Please leave the server.
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
timeLeft=$((timeLeft - 1))
|
||||||
|
done
|
||||||
|
|
||||||
# not stopping the server would cause problems
|
# not stopping the server would cause problems
|
||||||
# like world files aren't latest or even file corruptions
|
# like world files aren't latest or even file corruptions
|
||||||
|
|
Loading…
Reference in a new issue