|
|
@ -28,12 +28,6 @@ if [[ $status != active ]]; then |
|
|
|
exit |
|
|
|
fi |
|
|
|
|
|
|
|
# check if save is currently in progress |
|
|
|
if [[ $(mcbe-exec save query) != "A previous save has not been completed." ]]; then |
|
|
|
echo "Error: a save seems to be currently in progress. Did the previous save run correctly?" |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
|
|
|
|
# create backup dir |
|
|
|
if [[ ! -d "$backup_dir" ]]; then |
|
|
|
echo "Creating directory \"$backup_dir\" ..." |
|
|
@ -42,7 +36,12 @@ fi |
|
|
|
cd "$backup_dir" |
|
|
|
|
|
|
|
# prepare backup of active world |
|
|
|
mcbe-exec save hold |
|
|
|
status=$(mcbe-exec save hold) |
|
|
|
if [[ $status == "The command is already running" ]]; then |
|
|
|
echo "Error: a save seems to be currently in progress. Did the previous save run correctly?" |
|
|
|
mcbe-exec save resume |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
timeout=0 |
|
|
|
buffer=$(mcbe-exec save query) |
|
|
|
until echo "$buffer" | grep -q 'Data saved'; do |
|
|
|