fixed bug when system has multiple usernames starting with "root".

This commit is contained in:
Elijah Saxon 2005-03-21 17:48:34 +00:00
parent 7a8a4455be
commit 9f9a166978

View File

@ -27,7 +27,7 @@ dumpdir="$backupdir/sqldump"
# temporary ~/.my.cnf in root's home directory). # temporary ~/.my.cnf in root's home directory).
if [ "$dbusername" != "" ]; then 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)." [ -d $home ] || fatal "Can't find root's home directory ($home)."
mycnf="$home/.my.cnf" mycnf="$home/.my.cnf"
if [ -f $mycnf ]; then if [ -f $mycnf ]; then