From 03a7c14447fc40a4f575859181c3be8c2fccabdc Mon Sep 17 00:00:00 2001 From: trotFunky Date: Tue, 8 May 2018 15:52:25 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20l'option=20pour=20garder=20les=20p?= =?UTF-8?q?aram=C3=A8tres=20de=20la=20config=20dans=20leur=20=C3=A9tat=20a?= =?UTF-8?q?ctuel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Perso/auto_config.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Perso/auto_config.sh b/Perso/auto_config.sh index 99f4266..fe60387 100755 --- a/Perso/auto_config.sh +++ b/Perso/auto_config.sh @@ -32,7 +32,7 @@ function parameterTest { # Test si le paramètre $1 est égal à la valeur $2 et "force-yes" ) answer="y" ;; - "force-no" ) + "force-no" | "keep-cfg" ) answer="n" ;; esac @@ -59,7 +59,7 @@ function parameterTest { # Test si le paramètre $1 est égal à la valeur $2 et read answer done ;; - "force-yes" ) + "force-yes" | "keep-cfg" ) answer="y" ;; "force-no" ) @@ -110,7 +110,7 @@ if [ $# -eq 0 ]; then echo "Standard mode" mode="std" else - while getopts ":yYnN" option; do # Permet de gérer les options du script + while getopts ":yYnNkK" option; do # Permet de gérer les options du script case $option in y | Y ) echo "Forcing yes" @@ -120,8 +120,12 @@ else echo "Forcing no" mode="force-no" break;; + k | K ) + echo "Keeping parameter values" + mode="keep-cfg" + break;; * ) - echo "Invalid option used. Valid options are: (yYnN)" + echo "Invalid option used. Valid options are: (yYnNkK)" exit esac done