Browse Source

added infinite loop protection to mcbe maint script

feature/startup-from-labels
Mar Alegre 5 years ago
parent
commit
238c1efc13
  1. 6
      src/mcbe/assets/bin/maint

6
src/mcbe/assets/bin/maint

@ -33,7 +33,13 @@ if [[ 10#$hour -eq 1 ]]; then
# if no players are present, restart the server
# should help deal with any memory leaks or other bugs
players=""
tries = 0
while [[ -z $players ]]; do
if [[ $tries -eq 10 ]]; then
echo "Error: failed to get number of players present after 10 tries."
players=10
break
fi
players=$(mcbe-exec list | head -n 1 | cut -d ' ' -f 3 | cut -d '/' -f 1)
done
if [[ $players -eq 0 ]]; then

Loading…
Cancel
Save