From: clinton_admin Date: Sat, 25 Apr 2015 22:28:35 +0000 (-0400) Subject: mysql-grant-drop: exclude `performance_schema' database, consilidate conditionals X-Git-Url: https://git.hcoop.net/hcoop/scripts.git/commitdiff_plain/c1e3f8a218267459b38b99cb8260c994b02b3f3e mysql-grant-drop: exclude `performance_schema' database, consilidate conditionals --- diff --git a/mysql-grant-table-drop b/mysql-grant-table-drop index 3cf59db..316f3e9 100755 --- a/mysql-grant-table-drop +++ b/mysql-grant-table-drop @@ -16,8 +16,7 @@ MYSQL_DBS=`sudo -H mysqlshow | tail -n +4 | head -n -1 | cut -d' ' -f 2 | xargs` #echo "Mysql Databases are: $MYSQL_DBS" for DB in $MYSQL_DBS; do - if test "$DB" != "information_schema"; then - if test "$DB" != "mysql"; then + if (test "$DB" != "information_schema") && (test "$DB" != "mysql") && (test "$DB" != "performance_schema"); then USER=${DB%%_*} MYSQLDB_TABLES=`sudo -H mysqlshow $DB | tail -n +5 | head -n -1 | cut -d' ' -f 2 | xargs` @@ -29,6 +28,5 @@ for DB in $MYSQL_DBS; do done - fi # information_schema - fi # mysql + fi done