# Source the configuration variables
. ${cwd}/config
+db_name=${db_name:-"regress"}
+db_user=${db_user:-"regress"}
+db_password=${db_password:-""}
+
CLIENT=${HOST}-fd
AUTOCHANGER_SCRIPT=${AUTOCHANGER_SCRIPT:-mtx-changer}
bscan_libdbi
+# If the database has a password pass it to bscan
+if test "x${db_passwd}" = "x"; then
+ PASSWD=
+else
+ PASSWD="-P ${db_passwd}"
+fi
+
if test "$debug" -eq 1 ; then
- bin/bscan -w working $BSCANLIBDBI -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4
+ bin/bscan -w working $BSCANLIBDBI -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4
else
- bin/bscan -w working $BSCANLIBDBI -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 2>&1 >/dev/null
+ bin/bscan -w working $BSCANLIBDBI -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 2>&1 >/dev/null
fi
echo $BSCANLIBDBI
bscan_libdbi
-if test "$debug" -eq 1 ; then
- bin/bscan -w working $BSCANLIBDBI -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp
+# If the database has a password pass it to bscan
+if test "x${db_passwd}" = "x"; then
+ PASSWD=
else
- bin/bscan -w working $BSCANLIBDBI -u regress -n regress -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >tmp/log3.out
+ PASSWD="-P ${db_passwd}"
fi
-
+if test "$debug" -eq 1 ; then
+ bin/bscan -w working $BSCANLIBDBI -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp
+else
+ bin/bscan -w working $BSCANLIBDBI -u ${db_user} -n ${db_name} $PASSWD -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf ${cwd}/tmp 2>&1 >tmp/log3.out
+fi
cat <<END_OF_DATA >tmp/bconcmds
@$out /dev/null