aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar TheMightyV <themightyv@protonmail.com> 2022-01-08 12:07:00 +0100
committerGravatar TheMightyV <themightyv@protonmail.com> 2022-01-08 12:07:00 +0100
commit3257c178d20dff95bdb6177cd8ad6b85204e0165 (patch)
tree93a774c1917516830f165dad97cc08879607d354
parentd184a0c42497e3c9c7b2949092933fbca783b21d (diff)
downloadminecraft-server-tools-3257c178d20dff95bdb6177cd8ad6b85204e0165.tar.gz
require server-off for restoration in PWD only
-rwxr-xr-xserver.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/server.sh b/server.sh
index 2b58798..d9c06b7 100755
--- a/server.sh
+++ b/server.sh
@@ -302,8 +302,6 @@ function is_in() {
}
function server_restore() {
- assert_not_running
-
local backup_dir
local snapshot_index
local dest="$PWD"
@@ -317,6 +315,10 @@ function server_restore() {
dest="$3"
fi
+ if [ "$dest" = "$PWD" ]; then
+ assert_not_running
+ fi
+
if [ ${#BACKUP_DIRS[@]} -eq 0 ]; then
log_error "No backup directories found, abort"
return 1