murano-repository/muranorepository/Services/scripts/Linux/configureAccessToPostgreSql.sh
Serg Melikyan bd5ee0215c Add new services PostgreSQL and Tomcat
Change-Id: Id90b4eb8a9f0c5eada04a38ac4a5f1e022f97f48
2014-02-26 16:53:32 +04:00

27 lines
829 B
Bash

#!/bin/bash
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
echo -e "$inc_file_path not found!"
exit 1
fi
}
include "common.sh"
get_os
[[ $? -ne 0 ]] && exit 1
if [[ "$DistroBasedOn" != "redhat" ]]; then
DEBUGLVL=4
log "ERROR: We are sorry, only \"redhat\" based distribution of Linux supported for this service type, exiting!"
exit 1
fi
sed -e "s/YOURUSERNAMEHERE/$2/" -i /usr/share/tomcat/webapps/app/META-INF/context.xml
sed -e "s/YOURPASSWORDHERE/$3/" -i /usr/share/tomcat/webapps/app/META-INF/context.xml
sed -e "s/YOURHOSTHERE/$4/" -i /usr/share/tomcat/webapps/app/META-INF/context.xml
sed -e "s/YOURDATABASEHERE/$1/" -i /usr/share/tomcat/webapps/app/META-INF/context.xml