Use pre-existing setup user if existent
This commit is contained in:
parent
90ee796386
commit
260993c261
1 changed files with 13 additions and 9 deletions
|
@ -55,15 +55,19 @@ function runSetupUserAction -V dir
|
|||
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
|
||||
|
||||
begin
|
||||
echo "Creating setup user"
|
||||
|
||||
and useradd \
|
||||
--comment "PortValhalla Setup User" \
|
||||
--system \
|
||||
--groups nix-users \
|
||||
--create-home \
|
||||
--uid (getOSConfig setupUser.id --json) \
|
||||
"$name"
|
||||
if id -u "$name" &>/dev/null
|
||||
echo "Setup user already exists!"
|
||||
else
|
||||
echo "Creating setup user"
|
||||
|
||||
and useradd \
|
||||
--comment "PortValhalla Setup User" \
|
||||
--system \
|
||||
--groups nix-users \
|
||||
--create-home \
|
||||
--uid (getOSConfig setupUser.id --json) \
|
||||
"$name"
|
||||
end
|
||||
|
||||
and begin
|
||||
echo "$name ALL=(ALL:ALL) NOPASSWD: ALL"
|
||||
|
|
Loading…
Reference in a new issue