Skip to content
Permalink
Browse files

added verification for not uniq ftp user account

  • Loading branch information
serghey-rodin committed Jan 8, 2013
1 parent ca23ae6 commit 729c38416433c73930b46cc075d32f1851e80100
Showing with 7 additions and 1 deletion.
  1. +7 −1 bin/v-add-web-domain-ftp
@@ -43,8 +43,14 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
# Action #
#----------------------------------------------------------#

# Get domain values
get_domain_values 'web'
check_ftp_user=$(grep "^$ftp_user:" /etc/passwd)
if [ ! -z "$check_ftp_user" ] && [ "$FTP_USER" != "$ftp_user" ]; then
echo "Error: ftp user $ftp_user already exists"
log_event "$E_EXISTS $EVENT"
exit $E_EXISTS
fi

if [ ! -z "$FTP_USER" ]; then
/usr/sbin/userdel $FTP_USER
fi

0 comments on commit 729c384

Please sign in to comment.
You can’t perform that action at this time.