Run the entire setup script in tmux
This commit is contained in:
parent
fd5fc86b1b
commit
15bfed7f1f
1 changed files with 22 additions and 18 deletions
|
@ -8,26 +8,30 @@ if [ (id -u) -eq 0 ]
|
|||
set -l sudoConfig "/etc/sudoers.d/PortValhalla"
|
||||
rm ~/.bash_profile
|
||||
|
||||
begin
|
||||
echo "Creating setup user"
|
||||
if [ -z "$TMUX" ]
|
||||
tmux new-session (cat /proc/$fish_pid/cmdline | string split0)
|
||||
else
|
||||
begin
|
||||
echo "Creating setup user"
|
||||
|
||||
and useradd \
|
||||
--comment "PortValhalla Setup User" \
|
||||
--system \
|
||||
--no-user-group \
|
||||
--groups nix-users \
|
||||
--create-home \
|
||||
--uid (getOSConfig setupUser.id --json) \
|
||||
"$name"
|
||||
and useradd \
|
||||
--comment "PortValhalla Setup User" \
|
||||
--system \
|
||||
--no-user-group \
|
||||
--groups nix-users \
|
||||
--create-home \
|
||||
--uid (getOSConfig setupUser.id --json) \
|
||||
"$name"
|
||||
end
|
||||
|
||||
and begin
|
||||
echo "$name ALL=(ALL:ALL) NOPASSWD: ALL"
|
||||
end >"$sudoConfig"
|
||||
|
||||
and sudo --preserve-env --set-home --user "$name" "$INSTALLER_SCRIPT"
|
||||
rm "$sudoConfig"
|
||||
userdel -rf "$name"
|
||||
end
|
||||
|
||||
and begin
|
||||
echo "$name ALL=(ALL:ALL) NOPASSWD: ALL"
|
||||
end >"$sudoConfig"
|
||||
|
||||
and sudo --preserve-env --set-home --user "$name" "$INSTALLER_SCRIPT"
|
||||
rm "$sudoConfig"
|
||||
userdel -rf "$name"
|
||||
else
|
||||
if not type -q getDeploymentScript
|
||||
function getDeploymentScript
|
||||
|
|
Loading…
Reference in a new issue