|
|
@ -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 |
|
|
|