We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aace12f commit b531e9fCopy full SHA for b531e9f
func/rebuild.sh
@@ -20,13 +20,12 @@ rebuild_user_conf() {
20
fi
21
22
# Rebuild user
23
- shell=$(chsh --list-shells | grep -w "$SHELL" | head -n1)
24
- /usr/sbin/adduser "$user" -s "$shell" -c "$CONTACT" \
+ shell=$(grep -w "$SHELL" /etc/shells |head -n1)
+ /usr/sbin/useradd "$user" -s "$shell" -c "$CONTACT" \
25
-m -d "$HOMEDIR/$user" > /dev/null 2>&1
26
27
# 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
+ /usr/bin/chsh -s "$shell" "$user" &>/dev/null
30
31
# Update password
32
shadow=$(grep ^$user: /etc/shadow)
0 commit comments