Skip to content
Snippets Groups Projects
Commit 9f9a1669 authored by elijah's avatar elijah
Browse files

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

parent 7a8a4455
Branches
Tags
No related merge requests found
...@@ -27,7 +27,7 @@ dumpdir="$backupdir/sqldump" ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment