X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fbackupninja.git;a=blobdiff_plain;f=handlers%2Fmysql.in;fp=handlers%2Fmysql.in;h=f3230ad3ede61e1c2278c9a4ad1f63757aa3b3e0;hp=3b7423f21fa32ae72ea8f07e8a27a24ac0b54c4f;hb=a53e8a531a78465d449751864b19a13d4f993797;hpb=d65fa0c058b6a2e91126e1634aafd130807f58bd diff --git a/handlers/mysql.in b/handlers/mysql.in index 3b7423f..f3230ad 100644 --- a/handlers/mysql.in +++ b/handlers/mysql.in @@ -88,35 +88,35 @@ defaultsfile="" if [ "$dbusername" != "" -a "$dbpassword" != "" ] then - if [ $usevserver = yes ] - then - home=`$VSERVER $vsname exec getent passwd "root" | @AWK@ -F: '{print $6}'` - else - home=`getent passwd "root" | @AWK@ -F: '{print $6}'` - fi + if [ $usevserver = yes ] + then + home=`$VSERVER $vsname exec getent passwd "root" | @AWK@ -F: '{print $6}'` + else + home=`getent passwd "root" | @AWK@ -F: '{print $6}'` + fi - [ -d $home ] || fatal "Can't find root's home directory ($home)." + [ -d $home ] || fatal "Can't find root's home directory ($home)." - mycnf="$home/.my.cnf" + mycnf="$home/.my.cnf" - if [ $usevserver = yes ] - then + if [ $usevserver = yes ] + then workcnf="$vroot$mycnf" - else + else workcnf="$mycnf" - fi + fi - if [ -f $workcnf ] - then + if [ -f $workcnf ] + then # rename temporarily tmpcnf="$workcnf.disable" debug "mv $workcnf $tmpcnf" mv $workcnf $tmpcnf - fi + fi - oldmask=`umask` - umask 077 - cat > $workcnf < $workcnf <