Skip to content

Commit

Permalink
Fixes #49. Active file is now created when starting a server.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Whybrow committed Jul 15, 2012
1 parent 3760a18 commit b05d3a3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions init/msm
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,11 @@ server_wait_for_stop() {
server_set_active() {
case "$2" in
active)
as_user "${SERVER_USERNAME[$1]}" "touch \"${SERVER_FLAG_ACTIVE[$1]}\""
as_user "${SERVER_USERNAME[$1]}" "touch \"${SERVER_FLAG_ACTIVE_PATH[$1]}\""
SERVER_ACTIVE[$1]="true"
;;
inactive)
as_user "${SERVER_USERNAME[$1]}" "rm -f \"${SERVER_FLAG_ACTIVE[$1]}\""
as_user "${SERVER_USERNAME[$1]}" "rm -f \"${SERVER_FLAG_ACTIVE_PATH[$1]}\""
SERVER_ACTIVE[$1]="false"
;;
*)
Expand Down Expand Up @@ -2137,17 +2137,11 @@ server_load_properties() {
# $1: The id to use for this server
# $2: The name of the server
server_init() {
# Non-configurable Variables
SERVER_NAME[$1]="$2"
SERVER_PATH[$1]="$SETTINGS_SERVER_STORAGE_PATH/$2"

SERVER_BACKUP_PATH[$1]="$SETTINGS_BACKUP_ARCHIVE_PATH/${SERVER_NAME[$1]}"
SERVER_LOG_ARCHIVE_PATH[$1]="$SETTINGS_LOG_ARCHIVE_PATH/${SERVER_NAME[$1]}"

if [[ -e "${SERVER_FLAG_ACTIVE[$1]}" ]]; then
SERVER_ACTIVE[$1]="true"
else
SERVER_ACTIVE[$1]="false"
fi


# Setup default values for this server's variables using default settings
Expand All @@ -2169,6 +2163,12 @@ server_init() {
eval SERVER_${name}[$1]=\"${value}\"
done

if [[ -e "${SERVER_FLAG_ACTIVE_PATH[$1]}" ]]; then
SERVER_ACTIVE[$1]="true"
else
SERVER_ACTIVE[$1]="false"
fi

# Load setting overrides from server.properties
server_load_properties "$1"

Expand Down

0 comments on commit b05d3a3

Please sign in to comment.