Use pre-existing setup user if existent

This commit is contained in:
Manuel Thalmann 2024-12-04 18:35:15 +01:00
parent 12ad762841
commit a391e26027

View file

@ -55,6 +55,9 @@ function runSetupUserAction -V dir
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
begin
if id -u "$name" &>/dev/null
echo "Setup user already exists!"
else
echo "Creating setup user"
and useradd \
@ -64,6 +67,7 @@ function runSetupUserAction -V dir
--create-home \
--uid (getOSConfig setupUser.id --json) \
"$name"
end
and begin
echo "$name ALL=(ALL:ALL) NOPASSWD: ALL"