From: Micah Anderson Date: Tue, 27 Dec 2005 17:37:44 +0000 (+0000) Subject: r219@um: micah | 2005-12-27 10:32:24 -0500 X-Git-Tag: backupninja-0.9.2~19 X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fbackupninja.git;a=commitdiff_plain;h=06edbbddc536c3c7e204e54ca7897d9614307fcd r219@um: micah | 2005-12-27 10:32:24 -0500 Defaults file is now set correctly for vservers dbhost is now added to the .my.cnf --- diff --git a/handlers/mysql b/handlers/mysql index cb70104..408399d 100644 --- a/handlers/mysql +++ b/handlers/mysql @@ -115,19 +115,21 @@ fi # specify the password on the command line. defaultsfile="" + if [ "$dbusername" != "" -a "$dbpassword" != "" ] then if [ $usevserver ] then - home=`$VSERVER $vsname exec getent passwd "root" | awk -F: '{print $6}'` - home="$vroot$home" - debug "Home set to: $home" + vhome=`$VSERVER $vsname exec getent passwd "root" | awk -F: '{print $6}'` + home="$vroot$vhome" else home=`getent passwd "root" | awk -F: '{print $6}'` - debug "Home set to: $home" fi + [ -d $home ] || fatal "Can't find root's home directory ($home)." + mycnf="$home/.my.cnf" + if [ -f $mycnf ] then # rename temporarily @@ -135,27 +137,37 @@ then debug "mv $mycnf $tmpcnf" mv $mycnf $tmpcnf fi + oldmask=`umask` umask 077 cat > $mycnf <