added more warnings when using --keep-goig
This commit is contained in:
22
init.sh
22
init.sh
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Init: initialise a computer and conform it
|
# Init.sh: initialise a computer and conform it
|
||||||
# Copyright (c) 2019-2021 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
|
# Copyright (c) 2019-2021 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# This file is distributed under 3-clause BSD license.
|
# This file is distributed under 3-clause BSD license.
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
# defined before calling that script.
|
# defined before calling that script.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
# trace ERR through pipes
|
# trace ERR through pipes
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ export LC_ALL=C
|
|||||||
export LANG=C
|
export LANG=C
|
||||||
|
|
||||||
# Version of init
|
# Version of init
|
||||||
export VERSION="0.99.1"
|
export VERSION="0.99.3"
|
||||||
|
|
||||||
# Store script's path
|
# Store script's path
|
||||||
export MYPATH=$(dirname $0)
|
export MYPATH=$(dirname $0)
|
||||||
@@ -50,7 +51,7 @@ done
|
|||||||
# ==== Basic sanity checks ====
|
# ==== Basic sanity checks ====
|
||||||
# =============================
|
# =============================
|
||||||
|
|
||||||
# Check if a function exists
|
# Check if a function exists, return 0 if so
|
||||||
function_exists() {
|
function_exists() {
|
||||||
declare -f -F $1 > /dev/null
|
declare -f -F $1 > /dev/null
|
||||||
return $?
|
return $?
|
||||||
@@ -122,8 +123,18 @@ if [[ $CHECK_ONLY == true ]]; then
|
|||||||
prnt I "Mode de vérification seulement, on s'arrête là."
|
prnt I "Mode de vérification seulement, on s'arrête là."
|
||||||
exit 0
|
exit 0
|
||||||
else
|
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
|
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 "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 -e "${BYellow}Si vous continuez après cette étape le système sera modifié !${DEFAULTCOL}"
|
||||||
echo
|
echo
|
||||||
@@ -137,10 +148,11 @@ for mod in $MODULE_LIST; do
|
|||||||
fi
|
fi
|
||||||
# We need this only if JUMP is set but doesn't matter if it's done again
|
# We need this only if JUMP is set but doesn't matter if it's done again
|
||||||
. modules/$mod.sh
|
. modules/$mod.sh
|
||||||
|
echo $mod >> $STAGE_FILE
|
||||||
version=VER_$mod
|
version=VER_$mod
|
||||||
prnt I "Application des modifications pour $mod version ${!version}..."
|
prnt I "Application des modifications pour $mod version ${!version}..."
|
||||||
echo $mod >> $STAGE_FILE
|
|
||||||
$mod
|
$mod
|
||||||
done
|
done
|
||||||
|
|
||||||
prnt I "That's all folks !"
|
prnt I "That's all folks !"
|
||||||
|
rm -f $STAGEFILE
|
||||||
|
|||||||
Reference in New Issue
Block a user