Skip to content

Commit b531e9f

Browse files
committed
Ported user rebuild on Debian/Ubuntu
1 parent aace12f commit b531e9f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

func/rebuild.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ rebuild_user_conf() {
2020
fi
2121

2222
# Rebuild user
23-
shell=$(chsh --list-shells | grep -w "$SHELL" | head -n1)
24-
/usr/sbin/adduser "$user" -s "$shell" -c "$CONTACT" \
23+
shell=$(grep -w "$SHELL" /etc/shells |head -n1)
24+
/usr/sbin/useradd "$user" -s "$shell" -c "$CONTACT" \
2525
-m -d "$HOMEDIR/$user" > /dev/null 2>&1
2626

2727
# Update user shell
28-
shell_path=$(/usr/bin/chsh --list-shells | grep -w "$SHELL" |head -n1)
29-
/usr/bin/chsh -s "$shell_path" "$user" &>/dev/null
28+
/usr/bin/chsh -s "$shell" "$user" &>/dev/null
3029

3130
# Update password
3231
shadow=$(grep ^$user: /etc/shadow)

0 commit comments

Comments
 (0)