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,15 +55,19 @@ function runSetupUserAction -V dir
|
||||||
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
|
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
|
||||||
|
|
||||||
begin
|
begin
|
||||||
echo "Creating setup user"
|
if id -u "$name" &>/dev/null
|
||||||
|
echo "Setup user already exists!"
|
||||||
and useradd \
|
else
|
||||||
--comment "PortValhalla Setup User" \
|
echo "Creating setup user"
|
||||||
--system \
|
|
||||||
--groups nix-users \
|
and useradd \
|
||||||
--create-home \
|
--comment "PortValhalla Setup User" \
|
||||||
--uid (getOSConfig setupUser.id --json) \
|
--system \
|
||||||
"$name"
|
--groups nix-users \
|
||||||
|
--create-home \
|
||||||
|
--uid (getOSConfig setupUser.id --json) \
|
||||||
|
"$name"
|
||||||
|
end
|
||||||
|
|
||||||
and begin
|
and begin
|
||||||
echo "$name ALL=(ALL:ALL) NOPASSWD: ALL"
|
echo "$name ALL=(ALL:ALL) NOPASSWD: ALL"
|
||||||
|
|
Loading…
Reference in a new issue