Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

permit subdirectory for JAR_PATH #129

Open
TrogloGeek opened this issue Jan 7, 2013 · 0 comments
Open

permit subdirectory for JAR_PATH #129

TrogloGeek opened this issue Jan 7, 2013 · 0 comments
Assignees

Comments

@TrogloGeek
Copy link
Contributor

I configured DEFAULT_JAR_PATH as following:

DEFAULT_JAR_PATH="bin/server.jar"

It broke server_set_jar() if I don't manually create the bin folder for every server.
I modified the code as follows:

        if [[ ! -z "$jar" ]]; then
            as_user "${SERVER_USERNAME[$1]}" "ln -sf \"$jar\" \"${SERVER_JAR_PATH[$1]}\""
            echo "Server \"${SERVER_NAME[$1]}\" is now using \"$jar\"."
        fi

became

        if [[ ! -z "$jar" ]]; then
            local server_jar_dir=$(dirname "${SERVER_JAR_PATH[$1]}")
            if [ ! -d "$server_jar_dir" ]; then
                as_user "${SERVER_USERNAME[$1]}" "mkdir -p -m 0700 '$server_jar_dir'"
            fi
            as_user "${SERVER_USERNAME[$1]}" "ln -sf \"$jar\" \"${SERVER_JAR_PATH[$1]}\""
            echo "Server \"${SERVER_NAME[$1]}\" is now using \"$jar\"."
        fi

I also made a minor "improvement" (but perhaps you won't like it) to allow me issuing the msm server set jar command omitting the .jar extension :

            if [[ ! -e "$jar" ]] && [[ -e "$jar".jar ]]; then
                jar="$jar".jar
            fi

            if [[ ! -e "$jar" ]]; then
                error_exit NAME_NOT_FOUND "There is no jar named \"$3\" in jargroup \"$2\"."
            fi
@ghost ghost assigned marcuswhybrow Jan 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants