From: elijah Date: Mon, 21 Mar 2005 17:48:34 +0000 (+0000) Subject: fixed bug when system has multiple usernames starting with "root". X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=19296485409d49061fbc5dbcecb722aaa4980466;p=matthijs%2Fupstream%2Fbackupninja.git fixed bug when system has multiple usernames starting with "root". git-svn-id: http://code.autistici.org/svn/backupninja/trunk@98 758a04ac-41e6-0310-8a23-8373a73cc35d --- diff --git a/handlers/mysql b/handlers/mysql index 165ebc6..6a8c3dd 100644 --- a/handlers/mysql +++ b/handlers/mysql @@ -27,7 +27,7 @@ dumpdir="$backupdir/sqldump" # temporary ~/.my.cnf in root's home directory). if [ "$dbusername" != "" ]; then - home=`grep '^root' /etc/passwd | awk -F: '{print $6}'` + home=`grep '^root:' /etc/passwd | awk -F: '{print $6}'` [ -d $home ] || fatal "Can't find root's home directory ($home)." mycnf="$home/.my.cnf" if [ -f $mycnf ]; then