mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
Ported user rebuild on Debian/Ubuntu
This commit is contained in:
parent
aace12f63f
commit
b531e9f372
1 changed files with 3 additions and 4 deletions
|
@ -20,13 +20,12 @@ rebuild_user_conf() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Rebuild user
|
# Rebuild user
|
||||||
shell=$(chsh --list-shells | grep -w "$SHELL" | head -n1)
|
shell=$(grep -w "$SHELL" /etc/shells |head -n1)
|
||||||
/usr/sbin/adduser "$user" -s "$shell" -c "$CONTACT" \
|
/usr/sbin/useradd "$user" -s "$shell" -c "$CONTACT" \
|
||||||
-m -d "$HOMEDIR/$user" > /dev/null 2>&1
|
-m -d "$HOMEDIR/$user" > /dev/null 2>&1
|
||||||
|
|
||||||
# Update user shell
|
# Update user shell
|
||||||
shell_path=$(/usr/bin/chsh --list-shells | grep -w "$SHELL" |head -n1)
|
/usr/bin/chsh -s "$shell" "$user" &>/dev/null
|
||||||
/usr/bin/chsh -s "$shell_path" "$user" &>/dev/null
|
|
||||||
|
|
||||||
# Update password
|
# Update password
|
||||||
shadow=$(grep ^$user: /etc/shadow)
|
shadow=$(grep ^$user: /etc/shadow)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue