[refactor][fix] Update reinstall logic

* Only set reinstall flag if new accept_changes file exists
* Instead of stopping highstate from running, kill all salt processes and remove their configs
* Make end of non-reinstall logs clear in cases where user cancels (and log not rotated)
This commit is contained in:
William Wernert
2020-11-18 12:29:54 -05:00
parent 8a4defcffa
commit ad74b4b3e0
4 changed files with 22 additions and 24 deletions

View File

@@ -24,19 +24,10 @@ fi
cd "$(dirname "$0")" || exit 255
source ./so-variables
is_reinstall=false
if [[ -f $setup_log ]]; then
is_reinstall=true
# Move last setup log to backup
mv $setup_log $setup_log.bak
fi
source ./so-functions
source ./so-common-functions
source ./so-whiptail
source ./so-variables
# Parse command line arguments
setup_type=$1
@@ -63,6 +54,13 @@ while [[ $# -gt 0 ]]; do
esac
done
is_reinstall=false
if [[ -f $change_file ]]; then
is_reinstall=true
# Move last setup log to backup
mv "$setup_log" "$setup_log.bak"
fi
# Begin Installation pre-processing
parse_install_username
@@ -320,7 +318,6 @@ if [[ $is_import ]]; then
PLAYBOOK=0
fi
# Start user prompts
if [[ $is_helix || $is_sensor ]]; then
@@ -428,6 +425,7 @@ fi
if [[ $is_manager || $is_import ]]; then whiptail_so_allow; fi
whiptail_make_changes
touch $change_file
# From here on changes will be made.