Skip to content
Snippets Groups Projects
Commit 61409681 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

process db file only if it exists after db configuration

parent f45c8361
No related branches found
No related tags found
1 merge request!779Resolve "Debian package: use dbconfig-common"
......@@ -44,23 +44,26 @@ case "$1" in
invoke-rc.d --force postgresql restart || true
dbc_go minerva $@
. /etc/minerva/db.sh
# if there is a config file generated by db_config_common (on upgrade this file might not be generated)
if [ -f /etc/minerva/db.sh ]
. /etc/minerva/db.sh
# when configuration was cancelled don't create config file
if [ ! -z "$dbuser" ]
then
if [ -z "$dbport" ]
then
dbport=5432
fi
# when configuration was cancelled don't create config file
if [ -z "$dbuser" ]
then
if [ -z "$dbport" ]
then
dbport=5432
fi
#create db configuration file
echo "database.uri=jdbc:postgresql://$dbserver:$dbport/$dbname" > /etc/minerva/db.properties
echo "database.username=$dbuser" >> /etc/minerva/db.properties
echo "database.password=$dbpass" >> /etc/minerva/db.properties
#create db configuration file
echo "database.uri=jdbc:postgresql://$dbserver:$dbport/$dbname" > /etc/minerva/db.properties
echo "database.username=$dbuser" >> /etc/minerva/db.properties
echo "database.password=$dbpass" >> /etc/minerva/db.properties
fi
rm /etc/minerva/db.sh
fi
rm /etc/minerva/db.sh
#we have to restart tomcat, because application was started on the old database and it might crash during deployment
#for instance in the new war file there was init script that uses some new database features, but they are not
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment