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
|
exit 1
|
||||||
esac
|
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
|
# Function to create a new user
|
||||||
create_new_user() {
|
create_new_user() {
|
||||||
echo "Enter the username for the new user: "
|
echo "Enter the username for the new user: "
|
||||||
|
|
@ -68,12 +78,14 @@ create_new_user() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Asking if the user wants to create a new user
|
# Asking if the user wants to install Docker
|
||||||
echo "Do you want to create a new user? (y/n): "
|
echo "Do you want to install Docker & Docker Compose? (y/n): "
|
||||||
read CREATE_USER
|
read INSTALL_DOCKER
|
||||||
|
|
||||||
if [ "$CREATE_USER" = "y" ]; then
|
if [ "$INSTALL_DOCKER" = "y" ]; then
|
||||||
create_new_user
|
curl -sSL https://get.docker.com | sh
|
||||||
|
sudo usermod -aG docker $(whoami)
|
||||||
|
newgrp docker
|
||||||
else
|
else
|
||||||
echo "No new user will be created."
|
echo "Docker won't be installed."
|
||||||
fi
|
fi
|
||||||
Loading…
Reference in a new issue