]> git.sur5r.net Git - bacula/bacula/commitdiff
Add file
authorDan Langille <dan@langille.org>
Sun, 21 Dec 2003 23:23:52 +0000 (23:23 +0000)
committerDan Langille <dan@langille.org>
Sun, 21 Dec 2003 23:23:52 +0000 (23:23 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@927 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/drop_bacula_database.in [new file with mode: 0755]
bacula/src/cats/drop_bdb_database.in [new file with mode: 0644]
bacula/src/cats/drop_mysql_database.in [new file with mode: 0644]
bacula/src/cats/drop_postgresql_database.in [new file with mode: 0644]
bacula/src/cats/drop_sqlite_database.in [new file with mode: 0644]

diff --git a/bacula/src/cats/drop_bacula_database.in b/bacula/src/cats/drop_bacula_database.in
new file mode 100755 (executable)
index 0000000..d4aed3e
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+#  Drop Bacula database -- works for whatever is configured,
+#    MySQL, SQLite, PostgreSQL
+#
+if test xsqlite = x@DB_NAME@ ; then
+  @scriptdir@/drop_sqlite_database
+  echo "Dropped SQLite database"
+else
+  if test xmysql = x@DB_NAME@ ; then 
+    echo "Making MySQL database"
+    @scriptdir@/drop_mysql_database $*
+    echo "Dropped MySQL database"
+  else
+    # hardcoded database name - should be a parameter
+    @scriptdir@/drop_postgresql_database bacula
+    echo "Dropped PostgreSQL database"
+  fi
+fi
diff --git a/bacula/src/cats/drop_bdb_database.in b/bacula/src/cats/drop_bdb_database.in
new file mode 100644 (file)
index 0000000..f526590
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+# shell script to drop Bacula database(s)
+#
+#  Nothing to do 
diff --git a/bacula/src/cats/drop_mysql_database.in b/bacula/src/cats/drop_mysql_database.in
new file mode 100644 (file)
index 0000000..e5dfb60
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# shell script to drop Bacula database(s)
+#
+
+bindir=@SQL_BINDIR@
+
+if $bindir/mysql $* -f <<END-OF-DATA
+DROP DATABASE bacula;
+END-OF-DATA
+then
+   echo "Drop of bacula database succeeded."
+else
+   echo "Drop of bacula database failed."
+fi
+exit 0
diff --git a/bacula/src/cats/drop_postgresql_database.in b/bacula/src/cats/drop_postgresql_database.in
new file mode 100644 (file)
index 0000000..9ab41c5
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# shell script to drop Bacula database(s)
+#
+
+bindir=@SQL_BINDIR@
+
+if $bindir/psql $* -f - <<END-OF-DATA
+DROP DATABASE bacula;
+END-OF-DATA
+then
+   echo "Drop of bacula database succeeded."
+else
+   echo "Drop of bacula database failed."
+fi
+exit 0
diff --git a/bacula/src/cats/drop_sqlite_database.in b/bacula/src/cats/drop_sqlite_database.in
new file mode 100644 (file)
index 0000000..c10f3ca
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# shell script to drop Bacula SQLite tables
+
+bindir=@SQL_BINDIR@
+cd @working_dir@
+
+# how do we drop an sqlite database?
+#$bindir/sqlite $* bacula.db <<END-OF-DATA
+#END-OF-DATA
+exit 0