From: micah Date: Tue, 27 Dec 2005 17:37:44 +0000 (+0000) Subject: r219@um: micah | 2005-12-27 10:32:24 -0500 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;ds=sidebyside;h=246783bbd358ea427f90ba45a6ba18329f354460;p=matthijs%2Fupstream%2Fbackupninja-vserver.git 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 git-svn-id: http://code.autistici.org/svn/backupninja/trunk@280 758a04ac-41e6-0310-8a23-8373a73cc35d --- 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 <