Skip to content

Commit 852f937

Browse files
committed
change shell on package change
1 parent 0d9e7d0 commit 852f937

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

bin/v-change-user-package

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ fi
133133
# Changing user package
134134
change_user_package
135135

136+
# Update user shell
137+
shell_path=$(/usr/bin/chsh --list-shells | grep -w "$SHELL" |head -n1)
138+
/usr/bin/chsh -s "$shell_path" "$user" &>/dev/null
139+
136140

137141
#----------------------------------------------------------#
138142
# Vesta #

bin/v-rebuild-user

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ source $USER_DATA/user.conf
4040
shell=$(chsh --list-shells | grep -w "$SHELL" |head -n1)
4141
adduser "$user" -s "$shell" -c "$CONTACT" -m -d "$HOMEDIR/$user" &>/dev/null
4242

43+
# Update user shell
44+
shell_path=$(/usr/bin/chsh --list-shells | grep -w "$SHELL" |head -n1)
45+
/usr/bin/chsh -s "$shell_path" "$user" &>/dev/null
46+
4347
# Update password
4448
shadow='/etc/shadow'
4549
shdw=$(grep ^$user: $shadow)

0 commit comments

Comments
 (0)