Load the default shell from the user config

This commit is contained in:
Manuel Thalmann 2024-07-20 04:35:41 +02:00
parent c5149ef9b0
commit f77cd0d500

View file

@ -10,6 +10,7 @@ for name in (echo "$users" | jq '.[]' --raw-output0 | string split0)
end
set -l displayName (getUserConfig displayName --json)
set -l shell (getUserConfig defaultShell --json)
sudo useradd --create-home (
if echo "$displayName" | jq --exit-status > /dev/null
@ -19,6 +20,10 @@ for name in (echo "$users" | jq '.[]' --raw-output0 | string split0)
) --groups (getUserConfig groups --apply 'builtins.concatStringsSep ","') \
"$name"
if echo "$shell" | jq --exit-status > /dev/null
sudo chsh "$name" --shell (which (echo "$shell" | jq --raw-output))
end
echo "Please Choose a New Password for User `$name`"
while ! sudo passwd "$name"