Install Docker
This commit is contained in:
parent
b52cf56f46
commit
08dc9bd6a9
1 changed files with 18 additions and 6 deletions
24
script.sh
24
script.sh
|
|
@ -49,6 +49,16 @@ case "$DISTRO" in
|
|||
exit 1
|
||||
esac
|
||||
|
||||
# Asking if the user wants to create a new user
|
||||
echo "Do you want to create a new user? (y/n): "
|
||||
read CREATE_USER
|
||||
|
||||
if [ "$CREATE_USER" = "y" ]; then
|
||||
create_new_user
|
||||
else
|
||||
echo "No new user will be created."
|
||||
fi
|
||||
|
||||
# Function to create a new user
|
||||
create_new_user() {
|
||||
echo "Enter the username for the new user: "
|
||||
|
|
@ -68,12 +78,14 @@ create_new_user() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Asking if the user wants to create a new user
|
||||
echo "Do you want to create a new user? (y/n): "
|
||||
read CREATE_USER
|
||||
# Asking if the user wants to install Docker
|
||||
echo "Do you want to install Docker & Docker Compose? (y/n): "
|
||||
read INSTALL_DOCKER
|
||||
|
||||
if [ "$CREATE_USER" = "y" ]; then
|
||||
create_new_user
|
||||
if [ "$INSTALL_DOCKER" = "y" ]; then
|
||||
curl -sSL https://get.docker.com | sh
|
||||
sudo usermod -aG docker $(whoami)
|
||||
newgrp docker
|
||||
else
|
||||
echo "No new user will be created."
|
||||
echo "Docker won't be installed."
|
||||
fi
|
||||
Loading…
Reference in a new issue