cefb842c061e0295d3a7596f695e1980cbb5f8ae
jcasper
  Mon Oct 21 15:43:14 2013 -0700
checkGenomeMysql now tests all public server IP addresses instead of hard-coding public-mysql1, etc.
diff --git src/utils/qa/checkGenomeMysql src/utils/qa/checkGenomeMysql
index dcf0992..ac205ea 100755
--- src/utils/qa/checkGenomeMysql
+++ src/utils/qa/checkGenomeMysql
@@ -31,24 +31,27 @@
 if ! mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -Ne "show databases" | grep -qw $db
 then
   echo -e "\nERROR: database $db not found.\n" >&2
   exit 1
 fi
 
 tableList=$(mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -Ne "show tables" $db)
 
 # for each table in list do a select * limit 5.
 # Want to limit output or else the query would take forever. However,
 # can't do limit 1 since the first row of every table is stored in
 # the metadata and thus, mysql will not actually touch the table
 # if you do a select statement with a limit 1. Thus, we do a limit 5.
 # Throw away result of select statement and allow MySQL errors to be reported.
 # Also, genome-mysql is actually two hosts.  Check both.
+for ip in $(host genome-mysql.soe.ucsc.edu | awk '/has address/ {print $4}')
+do
   for table in $tableList
   do
-  mysql --user=genome --host=public-mysql1.cse.ucsc.edu -A -Ne "select * from $table limit 5" \
+    mysql --user=genome --host=$ip -A -Ne "select * from $table limit 5" \
         $db > /dev/null
 
 #PUT THIS BACK IF SD MACHINES COME BACK  mysql --user=genome --host=hgfs-sd.cse.ucsc.edu -A -Ne "select * from $table limit 5" \
 #      $db > /dev/null
   done
+done
 exit 0