I searched and could not find this answer anywhere else. Apologies if it's a bit of a noob question for someone not that experienced at scripting.
I'm trying to create a bash script to setup a server with all software needed for an application. In short, when installing docker I need to add the current user to the docker group 'usermod -aG docker ', and from there, pull some containers.
The problem I have is that because I've added the user to a group, they need to be logged out and back in again before they have any permission to do anything later in the script. This of course breaks the script and ends the shell session. Is there a way to log out and back in again within the same script, or do things need to get a little more complicated?
Appreciate anyone's help on this. Hope it's a simple answer for someone.