moved stage file deletion so resume can be used after using --shell or --check-only options

This commit is contained in:
2023-05-16 10:52:56 +02:00
parent dd1d97e625
commit 90e603be0c

12
init.sh
View File

@@ -36,7 +36,7 @@ export LC_ALL=C
export LANG=C
# Version of init
export VERSION="0.99.18"
export VERSION="0.99.19"
# Store script's path (realpath -s resolve symlinks if init.sh is a symlink)
export MYPATH=$(dirname $(realpath -s $0))
@@ -129,11 +129,6 @@ process_commandline_and_vars
set_system_proxy
# Reinit stage file if no resuming
if [[ $RESUME != true ]] && [[ -f $STAGE_FILE ]]; then
rm -f $STAGE_FILE
fi
# Loading activated modules
for mod in $MODULE_LIST; do
. modules/$mod.sh
@@ -237,6 +232,11 @@ read -n 1 -rsp $"Press <C> key to continue or an other one to stop now..." key &
echo && separator && echo
if [[ $key == "C" || $key == 'c' ]]; then
# Reinit stage file if no resuming
if [[ $RESUME != true ]] && [[ -f $STAGE_FILE ]]; then
rm -f $STAGE_FILE
fi
# We launch modules one after one
for mod in $MODULE_LIST; do
if [[ $RESUME == true ]] && [[ $(grep $mod $STAGE_FILE) ]]; then