-if [ "$user" == "" ]; then
- userset=false;
- user=root;
-else
- userset=true;
- if [ $usevserver ]
- then
- userhome=`$VSERVER $vsname exec getent passwd "$user" | awk -F: '{print $6}'`
- if [ $? -eq 2 ]
- then
- fatal "User $user not found in /etc/passwd"
- fi
- userhome="$vroot$userhome"
- info "User home set to: $userhome"
- [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf"
- else
- userhome=`getent passwd "$user" | awk -F: '{print $6}'`
- if [ $? -eq 2 ]
- then
- fatal "User $user not found in /etc/passwd"
- fi
- info "User home set to: $userhome"
- [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf"
- fi
-fi
-