added shell option
This commit is contained in:
23
init.sh
23
init.sh
@@ -36,7 +36,7 @@ export LC_ALL=C
|
||||
export LANG=C
|
||||
|
||||
# Version of init
|
||||
export VERSION="0.99.5"
|
||||
export VERSION="0.99.6"
|
||||
|
||||
# Store script's path
|
||||
export MYPATH=$(dirname $0)
|
||||
@@ -120,9 +120,22 @@ if [[ $RESUME != true ]]; then
|
||||
[[ -f $STAGE_FILE ]] && rm -f $STAGE_FILE
|
||||
fi
|
||||
|
||||
# Loading modules
|
||||
for mod in $MODULE_LIST; do
|
||||
. modules/$mod.sh
|
||||
done
|
||||
|
||||
if [[ $RUN_SHELL == true ]]; then
|
||||
OLD_PS1=$PS1
|
||||
export PS1="(init.sh) $PS1"
|
||||
bash
|
||||
export PS1=$OLD_PS1
|
||||
prnt I "Sortie du script après exécution du shell."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Run prechecks
|
||||
[[ JUMP != true ]] && for mod in $MODULE_LIST; do
|
||||
. modules/$mod.sh
|
||||
version=VER_$mod
|
||||
prnt I "Vérification initiale pour $mod version ${!version}..."
|
||||
precheck_$mod
|
||||
@@ -140,6 +153,7 @@ 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}"
|
||||
@@ -148,8 +162,10 @@ if [[ $KEEPGOING == true ]]; then
|
||||
fi
|
||||
echo -e "${BYellow}Si vous continuez après cette étape le système sera modifié !${DEFAULTCOL}"
|
||||
echo
|
||||
|
||||
while read -r -t 0.001; do :; done # Dump the buffer
|
||||
read -n 1 -rsp $"Appuyer sur la touche <C> pour continuer ou une autre pour s'arrêter...\n" key
|
||||
read -n 1 -rsp $"Appuyer sur la touche <C> pour continuer ou une autre pour s'arrêter..." key
|
||||
echo
|
||||
|
||||
if [[ $key == "C" || $key == 'c' ]]; then
|
||||
# We launch modules one after one
|
||||
@@ -158,7 +174,6 @@ if [[ $key == "C" || $key == 'c' ]]; then
|
||||
continue
|
||||
fi
|
||||
# We need this only if JUMP is set but doesn't matter if it's done again
|
||||
. modules/$mod.sh
|
||||
version=VER_$mod
|
||||
prnt I "Application des modifications pour $mod version ${!version}..."
|
||||
$mod
|
||||
|
||||
Reference in New Issue
Block a user