Use pre-existing setup user if existent
This commit is contained in:
parent
12ad762841
commit
a391e26027
1 changed files with 13 additions and 9 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue