X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Fmysql;h=55bfb25be0de184e9b4e1b897053d708e4eac19b;hb=d1632bb0f5d12c734344d5f90221d75200f17dd0;hp=4ac631b574bf9d2836b52d45c17246662d0571c2;hpb=e51747517197ac752d838226e4fa1528c6857408;p=matthijs%2Fupstream%2Fbackupninja-vserver.git diff --git a/handlers/mysql b/handlers/mysql index 4ac631b..55bfb25 100644 --- a/handlers/mysql +++ b/handlers/mysql @@ -56,8 +56,11 @@ then vroot="$VROOTDIR/$vsname" [ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'" # is it running ? - running=`$VSERVERINFO $vsname RUNNING` - [ $running = 1 ] || fatal "vserver $vsname is not running." + $VSERVERINFO $vsname RUNNING + if [ $? -ne 0 ] + then + fatal "vserver $vsname is not running." + fi fi # create backup dirs, the vroot variable will be empty if no vsname was specified @@ -95,7 +98,7 @@ fi defaultsfile="" if [ "$dbusername" != "" -a "$dbpassword" != "" ]; then - home=`grep '^root:' /etc/passwd | awk -F: '{print $6}'` + home=`getent passwd "root" | awk -F: '{print $6}'` [ -d $home ] || fatal "Can't find root's home directory ($home)." mycnf="$home/.my.cnf" if [ -f $mycnf ]; then