Ajout de l'option pour garder les paramètres de la config dans leur état actuel
This commit is contained in:
parent
4b5cca26d8
commit
03a7c14447
1 changed files with 8 additions and 4 deletions
|
@ -32,7 +32,7 @@ function parameterTest { # Test si le paramètre $1 est égal à la valeur $2 et
|
||||||
"force-yes" )
|
"force-yes" )
|
||||||
answer="y"
|
answer="y"
|
||||||
;;
|
;;
|
||||||
"force-no" )
|
"force-no" | "keep-cfg" )
|
||||||
answer="n"
|
answer="n"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -59,7 +59,7 @@ function parameterTest { # Test si le paramètre $1 est égal à la valeur $2 et
|
||||||
read answer
|
read answer
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
"force-yes" )
|
"force-yes" | "keep-cfg" )
|
||||||
answer="y"
|
answer="y"
|
||||||
;;
|
;;
|
||||||
"force-no" )
|
"force-no" )
|
||||||
|
@ -110,7 +110,7 @@ if [ $# -eq 0 ]; then
|
||||||
echo "Standard mode"
|
echo "Standard mode"
|
||||||
mode="std"
|
mode="std"
|
||||||
else
|
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
|
case $option in
|
||||||
y | Y )
|
y | Y )
|
||||||
echo "Forcing yes"
|
echo "Forcing yes"
|
||||||
|
@ -120,8 +120,12 @@ else
|
||||||
echo "Forcing no"
|
echo "Forcing no"
|
||||||
mode="force-no"
|
mode="force-no"
|
||||||
break;;
|
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
|
exit
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue