Browse Source

changed info messages for mcbe scripts

feature/startup-from-labels
Mar Alegre 5 years ago
parent
commit
985094084e
  1. 6
      src/mcbe/assets/bin/mcbe-restore
  2. 7
      src/mcbe/assets/bin/mcbe-shutdown

6
src/mcbe/assets/bin/mcbe-restore

@ -24,7 +24,7 @@ fi
worlds_dir=/home/mcadmin/worlds
# if worlds dir is non-empty, save it as worlds.bak
if [[ ! -z $(ls $worlds_dir) ]]; then
echo "Worlds directory is nonempty: saving backup of current state as $worlds_dir.bak"
echo "Worlds directory is nonempty: saving backup of worlds directory as $worlds_dir.bak"
if [[ -e $worlds_dir.bak ]]; then
rm -r $worlds_dir.bak
fi
@ -34,11 +34,11 @@ if [[ ! -z $(ls $worlds_dir) ]]; then
fi
# copy backup to worlds_dir
echo "Copying worlds from \"$backup_dir\" to \"$worlds_dir\"..."
echo "Copying worlds from backup directory..."
rsync -aSH "$backup_dir/" $worlds_dir/
# copy resources to each world in worlds_dir
echo "Copying resources to worlds in \"$worlds_dir\"..."
echo "Copying resources to worlds..."
resources_dir=/vol/data/resources
for d in $worlds_dir/*; do
rsync -aSH "$resources_dir/" "$d/"

7
src/mcbe/assets/bin/mcbe-shutdown

@ -26,6 +26,13 @@ else
exit 2
fi
# Check if server is active
status=$(systemctl show mcbe -p ActiveState --value)
if [[ $status != active ]]; then
echo "Error: Server is already stopped!"
exit 1
fi
say "Server shutting down in $time seconds!"
count=$(($time-1))
sleep 1

Loading…
Cancel
Save