]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/make_bacula_tables.in
Tweak some comments and formatting.
[bacula/bacula] / bacula / src / cats / make_bacula_tables.in
index c8469f12bf04e11fb7f36f201074d4c2e36e47c9..0d3539cf41f44664dba0e83e8274f4ddc75c250b 100755 (executable)
@@ -1,17 +1,44 @@
 #!/bin/sh
 #
 # This routine makes the appropriately configured
-#  Bacula tables for PostgreSQL, MySQL, or SQLite.
+# Bacula tables for PostgreSQL, Ingres, MySQL, or SQLite.
 #
-if test xsqlite3 = x@DB_TYPE@ ; then
-  echo "Making SQLite tables"
-  @scriptdir@/make_@DB_TYPE@_tables $*
-else
-  if test xmysql = x@DB_TYPE@ ; then 
-    echo "Making MySQL tables"
-    @scriptdir@/make_mysql_tables $*
-  else
-    echo "Making PostgreSQL tables"
-    @scriptdir@/make_postgresql_tables $*
-  fi
+
+default_db_type=@DEFAULT_DB_TYPE@
+
+#
+# See if the first argument is a valid backend name.
+# If so the user overrides the default database backend.
+#
+if [ $# -gt 0 ]; then
+   case $1 in
+     sqlite3)
+       db_type=$1
+       shift
+       ;;
+     mysql)
+       db_type=$1
+       shift
+       ;;
+     postgresql)
+       db_type=$1
+       shift
+       ;;
+     ingres)
+       db_type=$1
+       shift
+       ;;
+     *)
+       ;;
+   esac
+fi
+
+#
+# If no new db_type is gives use the default db_type.
+#
+if [ -z "${db_type}" ]; then
+   db_type="${default_db_type}"
 fi
+
+echo "Making ${db_type} tables"
+@scriptdir@/make_${db_type}_tables $*