From 4c2ac8ea23adcab6c439ec4552b7fa230ed7bc3d Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 21 Apr 2011 18:05:37 +0200 Subject: [PATCH] Use user arguments when upgrading catalog --- bacula/src/cats/update_mysql_tables.in | 2 +- bacula/src/cats/update_postgresql_tables.in | 2 +- bacula/updatedb/update_mysql_tables_11_to_12.in | 2 +- bacula/updatedb/update_postgresql_tables_11_to_12.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bacula/src/cats/update_mysql_tables.in b/bacula/src/cats/update_mysql_tables.in index 95783906af..8893acf296 100644 --- a/bacula/src/cats/update_mysql_tables.in +++ b/bacula/src/cats/update_mysql_tables.in @@ -12,7 +12,7 @@ bindir=@MYSQL_BINDIR@ PATH="$bindir:$PATH" db_name=@db_name@ -mysql ${db_name} -e "select VersionId from Version\G" >/tmp/$$ +mysql $* -D ${db_name} -e "select VersionId from Version\G" >/tmp/$$ DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$` if [ $DBVERSION != 12 ] ; then echo " " diff --git a/bacula/src/cats/update_postgresql_tables.in b/bacula/src/cats/update_postgresql_tables.in index cbc51850d3..e4809e0605 100644 --- a/bacula/src/cats/update_postgresql_tables.in +++ b/bacula/src/cats/update_postgresql_tables.in @@ -13,7 +13,7 @@ bindir=@POSTGRESQL_BINDIR@ PATH="$bindir:$PATH" db_name=@db_name@ -DBVERSION=`psql ${db_name} -t --pset format=unaligned -c "select VersionId from Version"` +DBVERSION=`psql -d ${db_name} -t --pset format=unaligned -c "select VersionId from Version" $*` if [ $DBVERSION != 12 ] ; then echo " " echo "The existing database is version $DBVERSION !!" diff --git a/bacula/updatedb/update_mysql_tables_11_to_12.in b/bacula/updatedb/update_mysql_tables_11_to_12.in index b2f6270e31..ea2afb67bd 100644 --- a/bacula/updatedb/update_mysql_tables_11_to_12.in +++ b/bacula/updatedb/update_mysql_tables_11_to_12.in @@ -10,7 +10,7 @@ bindir=@SQL_BINDIR@ PATH="$bindir:$PATH" db_name=@db_name@ -mysql ${db_name} -e "select VersionId from Version\G" >/tmp/$$ +mysql $* -D ${db_name} -e "select VersionId from Version\G" >/tmp/$$ DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$` if [ $DBVERSION != 11 ] ; then echo " " diff --git a/bacula/updatedb/update_postgresql_tables_11_to_12.in b/bacula/updatedb/update_postgresql_tables_11_to_12.in index 35f294ed9e..8cadf7abc4 100644 --- a/bacula/updatedb/update_postgresql_tables_11_to_12.in +++ b/bacula/updatedb/update_postgresql_tables_11_to_12.in @@ -11,7 +11,7 @@ bindir=@SQL_BINDIR@ PATH="$bindir:$PATH" db_name=@db_name@ -DBVERSION=`psql ${db_name} -t --pset format=unaligned -c "select VersionId from Version"` +DBVERSION=`psql -d ${db_name} -t --pset format=unaligned -c "select VersionId from Version" $*` if [ $DBVERSION != 11 ] ; then echo " " echo "The existing database is version $DBVERSION !!" -- 2.39.5