diff --git a/src/mcbe/assets/bin/mcbe-restore b/src/mcbe/assets/bin/mcbe-restore index f7ee553..ac6c0ff 100755 --- a/src/mcbe/assets/bin/mcbe-restore +++ b/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/" diff --git a/src/mcbe/assets/bin/mcbe-shutdown b/src/mcbe/assets/bin/mcbe-shutdown index 0446f9c..bdc53ae 100755 --- a/src/mcbe/assets/bin/mcbe-shutdown +++ b/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