From 2a4e238264480ed418332623e6ee5dbcc5e7b50c Mon Sep 17 00:00:00 2001 From: levasseur Date: Wed, 8 Sep 2021 15:47:13 +0200 Subject: [PATCH] added more warnings when using --keep-goig --- init.sh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/init.sh b/init.sh index c5ddd43..61e0c1e 100755 --- a/init.sh +++ b/init.sh @@ -1,6 +1,6 @@ #!/bin/bash # ------------------------------------------------------------------------------ -# Init: initialise a computer and conform it +# Init.sh: initialise a computer and conform it # Copyright (c) 2019-2021 Geoffray Levasseur # ------------------------------------------------------------------------------ # This file is distributed under 3-clause BSD license. @@ -16,6 +16,7 @@ # defined before calling that script. # ------------------------------------------------------------------------------ + # trace ERR through pipes set -o pipefail @@ -33,7 +34,7 @@ export LC_ALL=C export LANG=C # Version of init -export VERSION="0.99.1" +export VERSION="0.99.3" # Store script's path export MYPATH=$(dirname $0) @@ -50,7 +51,7 @@ done # ==== Basic sanity checks ==== # ============================= -# Check if a function exists +# Check if a function exists, return 0 if so function_exists() { declare -f -F $1 > /dev/null return $? @@ -122,8 +123,18 @@ if [[ $CHECK_ONLY == true ]]; then prnt I "Mode de vérification seulement, on s'arrête là." exit 0 else - [[ $JUMP == true ]] && print I "Toutes les vérification ont été faites." + if [[ $JUMP == true ]]; then + prnt W "Les vérification sont évités, attention !" + else + prnt I "Toutes les vérification ont été faites." + fi echo + if [[ $KEEPGOING == true ]]; then + echo -e "${BRed}ATTENTION : Vous avez demandé la poursuite du script en cas d'erreur.${DEFAULTCOL}" + echo -e "${BRed}ATTENTION : Cette option peut produires des résultats chaotiques.${DEFAULTCOL}" + echo -e "${BRed}ATTENTION : Cette option ne devrait être utilisé que sur système de test.${DEFAULTCOL}" + echo + fi echo "Appuyez sur CTLR + C maintenant si vous souhaitez interrompre." echo -e "${BYellow}Si vous continuez après cette étape le système sera modifié !${DEFAULTCOL}" echo @@ -137,10 +148,11 @@ for mod in $MODULE_LIST; do fi # We need this only if JUMP is set but doesn't matter if it's done again . modules/$mod.sh + echo $mod >> $STAGE_FILE version=VER_$mod prnt I "Application des modifications pour $mod version ${!version}..." - echo $mod >> $STAGE_FILE $mod done prnt I "That's all folks !" +rm -f $STAGEFILE