Normalize exit code of setup actions
This commit is contained in:
parent
b3f9e2dd23
commit
b61602cd68
1 changed files with 8 additions and 1 deletions
|
@ -55,6 +55,8 @@ function runSetupUserAction -V dir
|
||||||
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
|
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
set success true
|
||||||
|
|
||||||
if id -u "$name" &>/dev/null
|
if id -u "$name" &>/dev/null
|
||||||
echo "Setup user already exists!"
|
echo "Setup user already exists!"
|
||||||
else
|
else
|
||||||
|
@ -74,10 +76,15 @@ function runSetupUserAction -V dir
|
||||||
end >"$sudoConfig"
|
end >"$sudoConfig"
|
||||||
|
|
||||||
and sudo --preserve-env --set-home --user "$name" env "PATH=$PATH" $cmdline
|
and sudo --preserve-env --set-home --user "$name" env "PATH=$PATH" $cmdline
|
||||||
or read -P "An error occurred! Press enter to continue: "
|
or begin
|
||||||
|
read -P "An error occurred! Press enter to continue: "
|
||||||
|
set success false
|
||||||
|
end
|
||||||
|
|
||||||
disposeAction
|
disposeAction
|
||||||
rm "$sudoConfig"
|
rm "$sudoConfig"
|
||||||
userdel -rf "$name"
|
userdel -rf "$name"
|
||||||
|
success
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue