Skip to content

Commit

Permalink
Merge pull request #204 from IronTetsubo/issue198
Browse files Browse the repository at this point in the history
Fixed issue #198
  • Loading branch information
zachlatta committed Sep 14, 2013
2 parents 0ef8924 + ba2ed7d commit 5653c8d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions init/msm
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,13 @@ world_backup() {
# $1: The ID of the world
world_activate() {
server_property "${WORLD_SERVER_ID[$1]}" USERNAME
server_property "${WORLD_SERVER_ID[$1]}" WORLD_STORAGE_PATH
world_property "$1" INACTIVE_PATH
world_property "$1" ACTIVE_PATH

if [ -d "${WORLD_INACTIVE_PATH[$1]}" ]; then
echo -n "Moving world \"${WORLD_NAME[$1]}\" to the active worldstorage directory... "
local new_path="${WORLD_ACTIVE_PATH[$1]}"
local new_path="${SERVER_WORLD_STORAGE_PATH[${WORLD_SERVER_ID[$1]}]}"
as_user "${SERVER_USERNAME[${WORLD_SERVER_ID[$1]}]}" "mkdir -p \"$new_path\" && mv \"${WORLD_INACTIVE_PATH[$1]}\" \"$new_path\""
echo "Done."
else
Expand All @@ -414,6 +415,7 @@ world_activate() {
# $1: The ID of the world
world_deactivate() {
server_property "${WORLD_SERVER_ID[$1]}" USERNAME
server_property "${WORLD_SERVER_ID[$1]}" WORLD_STORAGE_INACTIVE_PATH
world_property "$1" ACTIVE_PATH
world_property "$1" INACTIVE_PATH
world_property "$1" PATH
Expand All @@ -423,7 +425,7 @@ world_deactivate() {
else
if [ -d "${WORLD_ACTIVE_PATH[$1]}" ]; then
echo -n "Moving world \"${WORLD_NAME[$1]}\" to the inactive worldstorage directory... "
local new_path="${WORLD_INACTIVE_PATH[$1]}"
local new_path="${SERVER_WORLD_STORAGE_INACTIVE_PATH[${WORLD_SERVER_ID[$1]}]}"
as_user "${SERVER_USERNAME[${WORLD_SERVER_ID[$1]}]}" "mkdir -p \"$new_path\" && mv \"${WORLD_PATH[$1]}\" \"$new_path\""
echo "Done."
else
Expand Down

0 comments on commit 5653c8d

Please sign in to comment.