- if [ $usevserver = yes ]
- then
- # Test to make sure mysqld is running, if it is not sqldump will not work
- $VSERVER $vsname exec su $user -c "$MYSQLADMIN $defaultsfile ping"
- if [ $? -ne 0 ]; then
- fatal "Either you have an authentication problem, or mysqld doesn't appear to be running!"
- fi
- if [ "$compress" == "yes" ]; then
- execstr="$VSERVER $vsname exec $DUMP | $GZIP > $vroot$dumpdir/${db}.sql.gz"
- else
- execstr="$VSERVER $vsname exec $DUMP -r $vroot$dumpdir/${db}.sql"
- fi
- else
- # Test to make sure mysqld is running, if it is not sqldump will not work
- su $user -c "$MYSQLADMIN $defaultsfile ping"
- if [ $? -ne 0 ]; then
- fatal "Either you have an authentication problem, or mysqld doesn't appear to be running!"
- fi
- if [ "$compress" == "yes" ]; then
- execstr="$DUMP | $GZIP > $dumpdir/${db}.sql.gz"
- else
- execstr="$DUMP -r $dumpdir/${db}.sql"
- fi
- fi
+ # Test to make sure mysqld is running, if it is not sqldump will not work
+ $vexec su $user -c "$MYSQLADMIN $defaultsfile ping"
+ if [ $? -ne 0 ]; then
+ fatal "Either you have an authentication problem, or mysqld doesn't appear to be running!"
+ fi
+ if [ "$compress" == "yes" ]; then
+ execstr="$vexec $DUMP | $GZIP > $vroot$dumpdir/${db}.sql.gz"
+ else
+ execstr="$vexec $DUMP -r $vroot$dumpdir/${db}.sql"
+ fi
+