fixe kaputten merge

This commit is contained in:
Jakobus Schürz 2022-07-25 15:21:48 +02:00
parent c26ef455c4
commit fb5c30ed8c
2 changed files with 0 additions and 102 deletions

View file

@ -1,4 +1,3 @@
<<<<<<< HEAD
#!/bin/bash
function help() {

View file

@ -1082,7 +1082,6 @@ getusedip () {
}
function getdbcreds_jra () {
<<<<<<< HEAD
local APP_INST=/opt/atlassian/jira
local JRA_HOME=$(awk -F "=" '/jira.home/ {gsub(/ /, "", $0); print $2}' "${APP_INST}/atlassian-jira/WEB-INF/classes/jira-application.properties")
local DB_FILE="${JRA_HOME}/dbconfig.xml"
@ -1096,48 +1095,6 @@ function getdbcreds_jra () {
DB_USER="$(grep -oPm1 "(?<=<username>)[^<]+" ${DB_FILE})"
DB_PWD="$(grep -oPm1 "(?<=<password>)[^<]+" ${DB_FILE})"
fi
||||||| ea90fa6
case $# in
0)
gojirahome
DB_FILE=dbconfig.xml
#cd -
;;
1)
DB_FILE=$1
;;
*)
echo "wrong number of arguments"
return 1
;;
esac
DB_URL="$(grep -oPm1 "(?<=<url>)[^<]+" ${DB_FILE})"
DB_USER="$(grep -oPm1 "(?<=<username>)[^<]+" ${DB_FILE})"
DB_PWD="$(grep -oPm1 "(?<=<password>)[^<]+" ${DB_FILE})"
=======
case $# in
0)
gojirahome
DB_FILE=dbconfig.xml
#cd -
;;
1)
DB_FILE=$1
;;
*)
echo "wrong number of arguments"
return 1
;;
esac
#DB_URL="$(grep -oPm1 "(?<=<url>)[^<]+" ${DB_FILE})"
#DB_USER="$(grep -oPm1 "(?<=<username>)[^<]+" ${DB_FILE})"
#DB_PWD="$(grep -oPm1 "(?<=<password>)[^<]+" ${DB_FILE})"
DB_URL="$(xmllint --xpath "jira-database-config/jdbc-datasource/url/text()" ${DB_FILE})"
DB_USER="$(xmllint --xpath "jira-database-config/jdbc-datasource/username/text()" ${DB_FILE})"
DB_PWD="$(xmllint --xpath "jira-database-config/jdbc-datasource/password/text()" ${DB_FILE})"
>>>>>>> ec99f40ff41338646804e8b105b1d4ad7799a6db
DB_HOST="$(echo $DB_URL|sed 's@^.*//@@;s@\(^.*\):\(.*\)/\(.*\)$@\1@')"
DB_PORT="$(echo $DB_URL|sed 's@^.*//@@;s@\(^.*\):\(.*\)/\(.*\)$@\2@')"
DB_NAME="$(echo $DB_URL|sed 's@^.*//@@;s@\(^.*\):\(.*\)/\(.*\)$@\3@')"
@ -1146,7 +1103,6 @@ function getdbcreds_jra () {
}
function getdbcreds_cnf () {
<<<<<<< HEAD
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 DB_FILE="${CNF_HOME}/confluence.cfg.xml"
@ -1160,48 +1116,6 @@ function getdbcreds_cnf () {
DB_USER="$(grep -oPm1 "(?<=<property name=\"hibernate.connection.username\">)[^<]+" ${DB_FILE})"
DB_PWD="$(grep -oPm1 "(?<=<property name=\"hibernate.connection.password\">)[^<]+" ${DB_FILE})"
fi
||||||| ea90fa6
case $# in
0)
gocnfhome
DB_FILE=confluence.cfg.xml
;;
1)
DB_FILE=$1
;;
*)
echo "wrong number of arguments"
cd -
return 1
;;
esac
DB_URL="$(grep -oPm1 "(?<=<property name=\"hibernate.connection.url\">)[^<]+" ${DB_FILE})"
DB_USER="$(grep -oPm1 "(?<=<property name=\"hibernate.connection.username\">)[^<]+" ${DB_FILE})"
DB_PWD="$(grep -oPm1 "(?<=<property name=\"hibernate.connection.password\">)[^<]+" ${DB_FILE})"
=======
case $# in
0)
gocnfhome
DB_FILE=confluence.cfg.xml
;;
1)
DB_FILE=$1
;;
*)
echo "wrong number of arguments"
cd -
return 1
;;
esac
# DB_URL="$(grep -oPm1 "(?<=<property name=\"hibernate.connection.url\">)[^<]+" ${DB_FILE})"
# DB_USER="$(grep -oPm1 "(?<=<property name=\"hibernate.connection.username\">)[^<]+" ${DB_FILE})"
# DB_PWD="$(grep -oPm1 "(?<=<property name=\"hibernate.connection.password\">)[^<]+" ${DB_FILE})"
DB_URL="$(xmllint --xpath "confluence-configuration/properties/property[@name='hibernate.connection.url']/text()" ${DB_FILE})"
DB_USER="$(xmllint --xpath "confluence-configuration/properties/property[@name='hibernate.connection.username']/text()" ${DB_FILE})"
DB_PWD="$(xmllint --xpath "confluence-configuration/properties/property[@name='hibernate.connection.password']/text()" ${DB_FILE})"
>>>>>>> ec99f40ff41338646804e8b105b1d4ad7799a6db
DB_HOST="$(echo $DB_URL|sed 's@^.*//@@;s@\(^.*\):\(.*\)/\(.*\)$@\1@')"
DB_PORT="$(echo $DB_URL|sed 's@^.*//@@;s@\(^.*\):\(.*\)/\(.*\)$@\2@')"
DB_NAME="$(echo $DB_URL|sed 's@^.*//@@;s@\(^.*\):\(.*\)/\(.*\)$@\3@')"
@ -1260,7 +1174,6 @@ urldecode() {
findlocallogins() {
last -F -a $(for i in $(find /var/log -maxdepth 1 -name "wtmp*"|sort -h);do echo -n "-f $i ";done)|grep -v "pts/\|reboot\|wtmp"|awk '{print $4,$5,$7}'|uniq
}
<<<<<<< HEAD
getjrahomes() {
local APP_INST=/opt/atlassian/jira
@ -1339,19 +1252,5 @@ gocnfshome() {
cd "${APP_SHARED_HOME}"
}
||||||| ea90fa6
=======
gojrahome() {
local APP_INST=/opt/atlassian/jira
cd $(awk -F "=" '/jira.home/ {gsub(/ /, "", $0); print $2}' "${APP_INST}/atlassian-jira/WEB-INF/classes/jira-application.properties")
}
gojrashome() {
local APP_INST=/opt/atlassian/jira
local JIRA_HOME=$(awk -F "=" '/jira.home/ {gsub(/ /, "", $0); print $2}' "${APP_INST}/atlassian-jira/WEB-INF/classes/jira-application.properties")
[ -e "${JIRA_HOME}/cluster.properties" ] && cd $(awk -F "=" '/jira.shared.home/ {gsub(/ /, "", $0); print $2}' "${JIRA_HOME}/cluster.properties") || echo no shared home configured >&2
}
>>>>>>> ec99f40ff41338646804e8b105b1d4ad7799a6db
#EOF