Suppression de la réponse automatique, l'utilisateur devra faire entrée pour valider son input du read

This commit is contained in:
2024-10-30 01:01:31 +01:00
parent 5e80941091
commit 17b9912e19
3 changed files with 13 additions and 13 deletions

View File

@@ -2,7 +2,7 @@
if command -v docker &> /dev/null; then
if ! command -v docker-compose &> /dev/null; then
# Si le docker compose de nginx reverse proxy n'est pas installé, demander confirmation avant installation
read -p "Le docker compose de nginx reverse proxy n'est pas installé. Voulez-vous l'installer? (o/n) " -r -d "n"
read -p "Le docker compose de nginx reverse proxy n'est pas installé. Voulez-vous l'installer? (o/n) "-d "n"
echo
if [[ $REPLY =~ ^[Oo]$ ]]; then
# Si l'utilisateur accepte, cloner le dépôt Git contenant le docker compose de nginx reverse proxy
@@ -24,7 +24,7 @@ fi
if command -v docker &> /dev/null; then
if ! docker ps -a --format '{{.Names}}' | grep -q grafana; then
# Si grafana n'est pas installé, demander confirmation avant installation
read -p "Grafana n'est pas installé. Voulez-vous l'installer? (o/n) " -r -d "n"
read -p "Grafana n'est pas installé. Voulez-vous l'installer? (o/n) " -d "n"
echo
if [[ $REPLY =~ ^[Oo]$ ]]; then
# Si l'utilisateur accepte, installer grafana
@@ -35,7 +35,7 @@ if command -v docker &> /dev/null; then
docker compose up -d
echo "Grafana a été installé avec succès!"
# Vérifier si l'utilisateur veut installer prometheus
read -p "Voulez-vous installer Prometheus? (o/n) " -r -d "n"
read -p "Voulez-vous installer Prometheus? (o/n) " -d "n"
echo
if [[ $REPLY =~ ^[Oo]$ ]]; then
# Si l'utilisateur accepte, installer prometheus
@@ -46,7 +46,7 @@ if command -v docker &> /dev/null; then
mkdir -p /home/$USER/docker/prometheus/prometheus
curl -o prometheus/prometheus.yml https://ganesh.turing.untypequicode.fr/untypequicode/script-vps/raw/branch/main/prometheus/prometheus/prometheus.yml
# Vérifier si l'utilisateur veut installer cadvisor
read -p "Voulez-vous installer cAdvisor? (o/n) " -r -d "n"
read -p "Voulez-vous installer cAdvisor? (o/n) " -d "n"
echo
if [[ $REPLY =~ ^[Oo]$ ]]; then
# Si l'utilisateur accepte, installer cadvisor
@@ -84,7 +84,7 @@ fi
# Vérifier si npm est déjà installé
if ! command -v npm &> /dev/null; then
# Si npm n'est pas installé, demander confirmation avant installation
read -p "npm n'est pas installé. Voulez-vous l'installer? (o/n) " -r
read -p "npm n'est pas installé. Voulez-vous l'installer? (o/n) "
echo
if [[ $REPLY =~ ^[Oo]$ ]]; then
# Si l'utilisateur accepte, installer npm
@@ -95,7 +95,7 @@ if ! command -v npm &> /dev/null; then
# Vérifier si nvm est déjà installé
if ! command -v nvm &> /dev/null; then
# Si nvm n'est pas installé, demander confirmation avant installation
read -p "nvm n'est pas installé. Voulez-vous l'installer? (o/n) " -r
read -p "nvm n'est pas installé. Voulez-vous l'installer? (o/n) "
echo
if [[ $REPLY =~ ^[Oo]$ ]]; then
# Si l'utilisateur accepte, installer nvm