Rectification du système de réponse pour o/n

This commit is contained in:
2024-10-30 01:19:34 +01:00
parent df1fe7b3b7
commit 20bf37ac77
4 changed files with 42 additions and 53 deletions

View File

@@ -6,9 +6,8 @@ USER=$(whoami)
# Vérifier si Git est déjà installé
if ! command -v git &> /dev/null; then
# Si Git n'est pas installé, demander confirmation avant installation
read -p "Git n'est pas installé. Voulez-vous l'installer? (o/n) " -n 1 -r -d "n"
echo
if [[ $REPLY =~ ^[Oo]$ ]]; then
read -p "Git n'est pas installé. Voulez-vous l'installer? (o/n) " response
if [[ $response =~ ^[Oo]$ ]]; then
# Si l'utilisateur accepte, installer Git
echo "Installation de Git en cours..."
sudo apt update
@@ -27,9 +26,8 @@ fi
# Vérifier si btop est déjà installé
if ! command -v btop &> /dev/null; then
# Si btop n'est pas installé, demander confirmation avant installation
read -p "btop n'est pas installé. Voulez-vous l'installer? (o/n) " -n 1 -r -d "n"
echo
if [[ $REPLY =~ ^[Oo]$ ]]; then
read -p "btop n'est pas installé. Voulez-vous l'installer? (o/n) " response
if [[ $response =~ ^[Oo]$ ]]; then
# Si l'utilisateur accepte, installer btop
echo "Installation de btop en cours..."
sudo apt update
@@ -45,9 +43,8 @@ fi
# Vérifier si tree est déjà installé
if ! command -v tree &> /dev/null; then
# Si tree n'est pas installé, demander confirmation avant installation
read -p "tree n'est pas installé. Voulez-vous l'installer? (o/n) " -n 1 -r -d "n"
echo
if [[ $REPLY =~ ^[Oo]$ ]]; then
read -p "tree n'est pas installé. Voulez-vous l'installer? (o/n) " response
if [[ $response =~ ^[Oo]$ ]]; then
# Si l'utilisateur accepte, installer tree
echo "Installation de tree en cours..."
sudo apt update
@@ -63,9 +60,8 @@ fi
# Vérifier si Docker est déjà installé
if ! command -v docker &> /dev/null; then
# Si Docker n'est pas installé, demander confirmation avant installation
read -p "Docker n'est pas installé. Voulez-vous l'installer? (o/n) " -n 1 -r -d "n"
echo
if [[ $REPLY =~ ^[Oo]$ ]]; then
read -p "Docker n'est pas installé. Voulez-vous l'installer? (o/n) " response
if [[ $response =~ ^[Oo]$ ]]; then
# Si l'utilisateur accepte, installer Docker
echo "Installation de Docker en cours..."
curl -fsSL https://get.docker.com -o get-docker.sh