update
This commit is contained in:
16
schedule-restart.sh
Executable file
16
schedule-restart.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
check_online() {
|
||||
docker compose exec spigot rcon list \
|
||||
| grep "^There are 0 of a max of" > /dev/null
|
||||
}
|
||||
|
||||
while ! check_online; do
|
||||
echo "Players are still online; re-checking in 60 seconds ..."
|
||||
sleep 60
|
||||
done
|
||||
|
||||
echo "No players are online; restarting now ..."
|
||||
|
||||
docker compose up -d spigot
|
||||
Reference in New Issue
Block a user