diff --git a/functions.sh b/functions.sh index ff05bb9..a16e95e 100755 --- a/functions.sh +++ b/functions.sh @@ -1104,7 +1104,7 @@ function getdbcreds_jra () { function getdbcreds_cnf () { local APP_INST=/opt/atlassian/confluence - local CNF_HOME=$(awk -F "=" '/jira.home/ {gsub(/ /, "", $0); print $2}' "${APP_INST}/confluence/WEB-INF/classes/confluence-init.properties") + local CNF_HOME=$(awk -F "=" '/confluence.home/ {gsub(/ /, "", $0); print $2}' "${APP_INST}/confluence/WEB-INF/classes/confluence-init.properties") local DB_FILE="${CNF_HOME}/confluence.cfg.xml" if xmllint --version >/dev/null 2>&1; then DB_URL="$(xmllint --xpath "confluence-configuration/properties/property[@name='hibernate.connection.url']/text()" ${DB_FILE})" @@ -1127,13 +1127,20 @@ function getdbcreds_cnf () { function connectdb () { - case $1 in - jra|jira) + case $HOSTNAME in + *jra*|*jira*) getdbcreds_jra $2 ;; - cnf|conf|confluence) + *cnf*|*confapp*) getdbcreds_cnf $2 ;; +# case $1 in +# jra|jira) +# getdbcreds_jra $2 +# ;; +# cnf|conf|confluence) +# getdbcreds_cnf $2 +# ;; *) echo "wrong argument" return 1