Skip to content

Commit

Permalink
Ported user rebuild on Debian/Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
serghey-rodin committed Oct 12, 2013
1 parent aace12f commit b531e9f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions func/rebuild.sh
Expand Up @@ -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)
Expand Down

0 comments on commit b531e9f

Please sign in to comment.