]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/updatedb/update_mysql_tables_6_to_7
Tweak add sm_dump comments in debug code
[bacula/bacula] / bacula / updatedb / update_mysql_tables_6_to_7
index 9eacdb0696f97df4f848ace14e39b9f98f6277e7..6507d97ed5c4d1252a18697cdba339dd1de34da3 100755 (executable)
@@ -11,6 +11,18 @@ echo " "
 # the location of the mysql program
 bindir=/usr/bin
 
+DB_VER=`$bindir/mysql bacula -e 'select * from Version;'|tail -n 1 2>/dev/null`
+if [ -z "$DB_VER" ]; then
+       echo "Sorry, I can't seem to locate a bacula database."
+       exit 1
+fi
+
+if [ -n "$DB_VER" ] && [ "$DB_VER" -ne "6" ]; then
+       echo "Sorry, this script is designed to update a version 6 database"
+       echo "and you have a version $DB_VER database."
+       exit 1
+fi
+
 if $bindir/mysql $* -f <<END-OF-DATA
 USE bacula;