mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
[fix][wip] Add reinstall_init function
Create a function that, if the setup log exists, puts the system into a state where the installer can run again without issue. This is WIP, there are most likely still issues.
This commit is contained in:
@@ -1411,6 +1411,24 @@ reserve_group_ids() {
|
|||||||
groupadd -g 946 cyberchef
|
groupadd -g 946 cyberchef
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reinstall_init() {
|
||||||
|
|
||||||
|
# Move last setup log to backup
|
||||||
|
mv $setup_log $setup_log.bak
|
||||||
|
|
||||||
|
# Stop salt so it won't highstate and start containers back up.
|
||||||
|
if [[ $install_type =~ ^(MANAGER|EVAL|HELIXSENSOR|MANAGERSEARCH|STANDALONE|IMPORT)$ ]]; then
|
||||||
|
systemctl stop salt-master
|
||||||
|
fi
|
||||||
|
systemctl stop salt-minion
|
||||||
|
|
||||||
|
# Remove startup highstate from minion config so we don't immediately highstate when salt starts back up
|
||||||
|
sed -i '/startup_states/d' $minion_config
|
||||||
|
|
||||||
|
# Stop all containers so files can be changed with more safety
|
||||||
|
docker stop $(docker ps -a -q)
|
||||||
|
}
|
||||||
|
|
||||||
# When updating the salt version, also update the version in securityonion-builds/images/iso-task/Dockerfile and salt/salt/master.defaults.yaml and salt/salt/minion.defaults.yaml
|
# When updating the salt version, also update the version in securityonion-builds/images/iso-task/Dockerfile and salt/salt/master.defaults.yaml and salt/salt/minion.defaults.yaml
|
||||||
saltify() {
|
saltify() {
|
||||||
|
|
||||||
@@ -1566,7 +1584,6 @@ saltify() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
salt_checkin() {
|
salt_checkin() {
|
||||||
|
|
||||||
case "$install_type" in
|
case "$install_type" in
|
||||||
'MANAGER' | 'EVAL' | 'HELIXSENSOR' | 'MANAGERSEARCH' | 'STANDALONE' | 'IMPORT') # Fix Mine usage
|
'MANAGER' | 'EVAL' | 'HELIXSENSOR' | 'MANAGERSEARCH' | 'STANDALONE' | 'IMPORT') # Fix Mine usage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ done
|
|||||||
# Begin Installation pre-processing
|
# Begin Installation pre-processing
|
||||||
parse_install_username
|
parse_install_username
|
||||||
|
|
||||||
|
if [[ -f $setup_log ]]; then
|
||||||
|
reinstall_init
|
||||||
|
fi
|
||||||
|
|
||||||
title "Initializing Setup"
|
title "Initializing Setup"
|
||||||
info "Installing as the $INSTALLUSERNAME user"
|
info "Installing as the $INSTALLUSERNAME user"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user