Permalink
Browse files

Fix for additional accounts on Ubuntu and Debian

  • Loading branch information...
serghey-rodin committed Oct 12, 2013
1 parent 845e5f9 commit aace12f63f78c45ddd1eb1aa92ae4943269eefb8
Showing with 14 additions and 8 deletions.
  1. +5 −6 bin/v-add-web-domain-ftp
  2. +9 −2 func/rebuild.sh
View
@@ -52,7 +52,7 @@ if [ ! -z "$check_ftp_user" ] && [ "$FTP_USER" != "$ftp_user" ]; then
fi
if [ ! -z "$FTP_USER" ]; then
/usr/sbin/userdel -f $FTP_USER
/usr/sbin/userdel -f $FTP_USER > /dev/null 2>&1
fi
# Define shell
@@ -62,12 +62,11 @@ if [ -e "/usr/bin/rssh" ]; then
fi
# Adding user
/usr/sbin/adduser -o -u $(id -u $user) \
-g $user \
/usr/sbin/useradd $ftp_user \
-s $shell \
-M -d "$HOMEDIR/$user/web/$domain" \
$ftp_user > /dev/null 2>&1
-o -u $(id -u $user) \
-g $user \
-M -d "$HOMEDIR/$user/web/$domain" > /dev/null 2>&1
echo "$ftp_user:$ftp_password" | /usr/sbin/chpasswd
ftp_md5="$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)"
View
@@ -322,8 +322,15 @@ rebuild_web_domain_conf() {
# Checking ftp
if [ ! -z "$FTP_USER" ]; then
if [ -z "$(grep ^$FTP_USER: /etc/passwd)" ]; then
/usr/sbin/adduser -o -u $(id -u $user) -g $user -s /sbin/nologin \
-M -d "$HOMEDIR/$user/web/$domain" $FTP_USER > /dev/null 2>&1
shell='/sbin/nologin'
if [ -e "/usr/bin/rssh" ]; then
shell='/usr/bin/rssh'
fi
/usr/sbin/useradd $FTP_USER \
-s $shell \
-o -u $(id -u $user) \
-g $user \
-M -d "$HOMEDIR/$user/web/$domain" > /dev/null 2>&1
# Update password
shadow=$(grep "^$FTP_USER:" /etc/shadow)

0 comments on commit aace12f

Please sign in to comment.