Skip to content

Commit

Permalink
Extract default database type from config.
Browse files Browse the repository at this point in the history
As the bareos-config script is non-portable (bash) we better extract the
default database backend from the bareos-dir.conf. To be even more sure
the script uses the right database type the call to it should just
include the 5th argument which is the database type in the config so we
are not dependent on any default type guessing.
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent e6aaaf0 commit 29161fd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/cats/make_catalog_backup.in
Expand Up @@ -18,9 +18,14 @@
# $5 is the type of database
#
#
CFG="@sysconfdir@/bareos-dir.conf"
DBCHECK="@sbindir@/bareos-dbcheck"

default_db_type=`@scriptdir@/bareos-config get_database_driver_default`

default_db_type=`${DBCHECK} -B -c ${CFG} | \
grep 'db_type=' | \
head -1 | \
cut -d'=' -f2 | \
tr '[A-Z]' '[a-z]'`

#
# See if the fifth argument is a valid backend name.
Expand Down

0 comments on commit 29161fd

Please sign in to comment.