From e9e19af5075941183d9538761438a09843f309b1 Mon Sep 17 00:00:00 2001 From: Nick Hepler Date: Mon, 14 Oct 2024 17:57:19 -0400 Subject: [PATCH] Move usermod to install_docker function. --- setup.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index c8f7463..a49c40b 100644 --- a/setup.sh +++ b/setup.sh @@ -49,7 +49,10 @@ install_docker() { systemctl start docker systemctl enable docker echo "Docker installation complete." - docker_installed=true # Set the flag to true + + usermod -aG docker "$username" + echo "User $username added to the docker group." + } # Function to create a limited user account @@ -65,12 +68,6 @@ create_user_account() { useradd -m -G wheel "$username" echo "$username:$password" | chpasswd echo "User $username created and added to the wheel group." - - # Add the user to the docker group if Docker is installed - if [ "$docker_installed" = true ]; then - usermod -aG docker "$username" - echo "User $username added to the docker group." - fi fi }