X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Fmysql;h=b54ae95daf7d771513487f7737e6485954c50f9d;hb=8e82b211728e35616164d2a3b11dc05bce44ad92;hp=55bfb25be0de184e9b4e1b897053d708e4eac19b;hpb=d1632bb0f5d12c734344d5f90221d75200f17dd0;p=matthijs%2Fupstream%2Fbackupninja-vserver.git diff --git a/handlers/mysql b/handlers/mysql index 55bfb25..b54ae95 100644 --- a/handlers/mysql +++ b/handlers/mysql @@ -51,19 +51,19 @@ fi # If needed, make sure that the specified vserver exists and is running. if [ $usevserver ] then - info "examining vserver '$vsname'" + info "Examining vserver '$vsname'" # does it exist ? vroot="$VROOTDIR/$vsname" [ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'" # is it running ? - $VSERVERINFO $vsname RUNNING + $VSERVERINFO -q $vsname RUNNING if [ $? -ne 0 ] then fatal "vserver $vsname is not running." fi fi -# create backup dirs, the vroot variable will be empty if no vsname was specified +# create backup dirs, vroot variable will be empty if no vsname was specified # and will proceed to operate on the host [ -d $vroot$backupdir ] || mkdir -p $vroot$backupdir [ -d $vroot$backupdir ] || fatal "Backup directory '$vroot$backupdir'" @@ -97,19 +97,26 @@ fi # specify the password on the command line. defaultsfile="" -if [ "$dbusername" != "" -a "$dbpassword" != "" ]; then - home=`getent passwd "root" | awk -F: '{print $6}'` - [ -d $home ] || fatal "Can't find root's home directory ($home)." - mycnf="$home/.my.cnf" - if [ -f $mycnf ]; then - # rename temporarily - tmpcnf="$home/my.cnf.disable" - debug "mv $mycnf $tmpcnf" - mv $mycnf $tmpcnf - fi - oldmask=`umask` - umask 077 - cat > $mycnf < $mycnf <