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
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment