dup: added option --force to cleanup and remove-older-than commands, else they actual...
[matthijs/upstream/backupninja.git] / handlers / mysql.in
index 64b6f492188b31429ceb9249abd9c748fd68d99c..fe1e7832f32ee43c090cf5e17d6e985e040f8376 100644 (file)
@@ -31,10 +31,7 @@ if [ $vservers_are_available = yes ]; then
          fatal "The vserver given in vsname ($vsname) does not exist."
       fi
       # is it running ?
-      $VSERVERINFO -q $vsname RUNNING
-      if [ $? -ne 0 ]; then
-         fatal "The vserver $vsname is not running."
-      fi
+      vservers_running $vsname || fatal "The vserver $vsname is not running."
       # everything ok
       info "Using vserver '$vsname'."
       usevserver=yes
@@ -238,7 +235,7 @@ then
                fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?"
            fi
        else
-               databases=`echo 'show databases' | su $user -c "$MYSQL $defaultsfile" | grep -v Database`
+               databases=$(su $user -c "$MYSQL $defaultsfile -N -B -e 'show databases'" | sed 's/|//g;/\+----/d')
                if [ $? -ne 0 ]
                then
                    fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?"