From 36866f4803a4f6e9e323facbf8e9e4cdf2329404 Mon Sep 17 00:00:00 2001 From: fatalerrors Date: Thu, 22 Jul 2021 12:52:16 +0200 Subject: [PATCH] implemented basic resume system (needs improvements) --- init.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init.sh b/init.sh index cf7e8b9..7fc2eac 100755 --- a/init.sh +++ b/init.sh @@ -90,6 +90,11 @@ load_configuration process_commandline_and_vars +# Reinit stage file if no resuming +if [[ $RESUME != true ]]; then + [[ -f $STAGE_FILE ]] && rm -f $STAGE_FILE +fi + # Run prechecks [[ JUMP != true ]] && for mod in $MODULE_LIST; do . modules/$mod.sh @@ -113,10 +118,14 @@ fi # We launch modules one after one for mod in $MODULE_LIST; do + if [[ $RESUME == true ]] && [[ $(grep $mod $STAGE_FILE) ]]; 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}..." + echo $mod >> $STAGE_FILE $mod done