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 }