From b531e9f37241136e0d308743cc6c358c2e58a17f Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 12 Oct 2013 18:42:34 +0300 Subject: [PATCH] Ported user rebuild on Debian/Ubuntu --- func/rebuild.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/func/rebuild.sh b/func/rebuild.sh index 68e1f18c..e7c8d9b9 100644 --- a/func/rebuild.sh +++ b/func/rebuild.sh @@ -20,13 +20,12 @@ rebuild_user_conf() { fi # Rebuild user - shell=$(chsh --list-shells | grep -w "$SHELL" | head -n1) - /usr/sbin/adduser "$user" -s "$shell" -c "$CONTACT" \ + shell=$(grep -w "$SHELL" /etc/shells |head -n1) + /usr/sbin/useradd "$user" -s "$shell" -c "$CONTACT" \ -m -d "$HOMEDIR/$user" > /dev/null 2>&1 # Update user shell - shell_path=$(/usr/bin/chsh --list-shells | grep -w "$SHELL" |head -n1) - /usr/bin/chsh -s "$shell_path" "$user" &>/dev/null + /usr/bin/chsh -s "$shell" "$user" &>/dev/null # Update password shadow=$(grep ^$user: /etc/shadow)