Default dbname for migration of L&B proxy.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Fri, 19 Jun 2009 09:48:18 +0000 (09:48 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Fri, 19 Jun 2009 09:48:18 +0000 (09:48 +0000)
org.glite.lb.server/config/glite-lb-migrate_db2version20

index f59d647..a547fbf 100644 (file)
@@ -25,9 +25,6 @@ EOF
 SERVER=""
 PROXY=""
 
-#default DB name (may be overriden by -d option)
-DB_NAME="lbserver20"
-
 while getopts "spd:h" OPTION 
 do
     case "$OPTION" in 
@@ -59,6 +56,16 @@ if [ "$SERVER" -a "$PROXY" ]; then
 fi
 
 
+# default DB name (for server or proxy, overriden by -d option)
+if [ -z "$DB_NAME" ]; then
+       if [ "$SERVER" ]; then
+               DB_NAME="lbserver20"
+       else
+               DB_NAME="lbproxy"
+       fi
+fi
+
+
 # convert for transactions (if needed and very old DB)
 for table in jobs users events short_fields long_fields states status_tags server_state acls notif_registrations notif_jobs; do
        echo "SHOW CREATE TABLE $table;" | mysql -u lbserver $DB_NAME | grep -i ENGINE | grep -i InnoDB >/dev/null