X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fupdatedb%2Fupdate_mysql_tables_6_to_7;h=6507d97ed5c4d1252a18697cdba339dd1de34da3;hb=0e17f32019eb391f04b1dd7cbad8206863caf053;hp=9eacdb0696f97df4f848ace14e39b9f98f6277e7;hpb=92e15e22ea5cd563b31dde856abff4033f382976;p=bacula%2Fbacula diff --git a/bacula/updatedb/update_mysql_tables_6_to_7 b/bacula/updatedb/update_mysql_tables_6_to_7 index 9eacdb0696..6507d97ed5 100755 --- a/bacula/updatedb/update_mysql_tables_6_to_7 +++ b/bacula/updatedb/update_mysql_tables_6_to_7 @@ -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 <