Skip to content
Browse files
Ported user rebuild on Debian/Ubuntu
  • Loading branch information
serghey-rodin committed Oct 12, 2013
1 parent aace12f commit b531e9f37241136e0d308743cc6c358c2e58a17f
Showing 1 changed file with 3 additions and 4 deletions.
@@ -20,13 +20,12 @@ rebuild_user_conf() {

# 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)

0 comments on commit b531e9f

Please sign in to comment.