Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Extract default database type from config.
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 May 5, 2013
1 parent 77ed219 commit 0f724ec
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 0f724ec

Please sign in to comment.