From c07821a612a1098c04402510a8dd90bd5bd4ef16 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Wed, 11 Jan 2023 12:32:43 -0500 Subject: [PATCH] Fix reinstall logic --- setup/so-functions | 13 +++++++++++++ setup/so-setup | 2 +- setup/so-variables | 12 ------------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 090f5f572..53c539a1b 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1529,6 +1529,19 @@ influxdb_pillar() { touch $influxdb_pillar_file } +make_some_dirs() { + mkdir -p $local_salt_dir/pillar/minions + mkdir -p $local_salt_dir/salt/firewall/hostgroups + mkdir -p $local_salt_dir/salt/firewall/portgroups + mkdir -p $local_salt_dir/salt/firewall/ports + + for THEDIR in bpf pcap elasticsearch ntp firewall redis backup influxdb strelka sensoroni curator soc soctopus docker zeek suricata nginx telegraf filebeat logstash soc manager kratos idstools idh elastalert;do + mkdir -p $local_salt_dir/pillar/$THEDIR + touch $local_salt_dir/pillar/$THEDIR/adv_$THEDIR.sls + touch $local_salt_dir/pillar/$THEDIR/soc_$THEDIR.sls + done +} + mark_version() { title "Marking the current version" echo "$SOVERSION" > /etc/soversion diff --git a/setup/so-setup b/setup/so-setup index 914b80233..9ed3a30cb 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -141,7 +141,6 @@ if [[ -f /root/accept_changes ]]; then info "Old setup detected. Moving the last setup.log to setup.log.bak" mv "$setup_log" "$setup_log.bak" [ -f "$error_log" ] && mv "$error_log" "$error_log.bak" - source ./so-variables reinstall_init fi @@ -472,6 +471,7 @@ if ! [[ -f $install_opt_file ]]; then if [[ $waitforstate ]]; then touch /root/accept_changes + make_some_dirs percentage=0 es_heapsize ls_heapsize diff --git a/setup/so-variables b/setup/so-variables index 9cf279f3d..a753bc91b 100644 --- a/setup/so-variables +++ b/setup/so-variables @@ -79,18 +79,6 @@ export ntp_string whiptail_title="Security Onion Setup - $SOVERSION" export whiptail_title -mkdir -p $local_salt_dir/pillar/minions -mkdir -p $local_salt_dir/salt/firewall/hostgroups -mkdir -p $local_salt_dir/salt/firewall/portgroups -mkdir -p $local_salt_dir/salt/firewall/ports - -for THEDIR in bpf pcap elasticsearch ntp firewall redis backup influxdb strelka sensoroni curator soc soctopus docker zeek suricata nginx telegraf filebeat logstash soc manager kratos idstools idh elastalert -do - mkdir -p $local_salt_dir/pillar/$THEDIR - touch $local_salt_dir/pillar/$THEDIR/adv_$THEDIR.sls - touch $local_salt_dir/pillar/$THEDIR/soc_$THEDIR.sls -done - global_pillar_file="$local_salt_dir/pillar/soc_global.sls" export global_pillar_file