# (default = bacula).
# $3 is the password with which to access the database or "" if no password
# (default "")
+# $4 is the host on which the database is located
+# (default "")
#
#
BINDIR=@SQL_BINDIR@
else
MYSQLPASSWORD=""
fi
- ${BINDIR}/mysqldump -u $2$MYSQLPASSWORD -f --opt $1 >$1.sql
+ if test $# -gt 3; then
+ MYSQLHOST=" --host=$4"
+ else
+ MYSQLHOST=""
+ fi
+ ${BINDIR}/mysqldump -u $2$MYSQLPASSWORD$MYSQLHOST -f --opt $1 >$1.sql
else
if test xpostgresql = x@DB_TYPE@ ; then
if test $# -gt 2; then
PGPASSWORD=$3
export PGPASSWORD
fi
- exec ${BINDIR}/pg_dump -c -U $2 $1 >$1.sql
+ if test $# -gt 3; then
+ PGHOST=" --host=$4"
+ else
+ PGHOST=""
+ fi
+ exec ${BINDIR}/pg_dump -c $PGHOST -U $2 $1 >$1.sql
else
echo ".dump" | ${BINDIR}/sqlite3 $1.db >$1.sql
fi