The underlying problem is the parse error on this line:
hash1=$(md5sum dbPath/testdb.sql) | awk '{print $1}'
which should almost certainly be
hash1=$(md5sum dbPath/testdb.sql | awk '{print $1}')
You can check for errors like this at https://shellcheck.net