mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 01:32:47 +01:00
Merge pull request #13825 from Security-Onion-Solutions/issue/13808
Issue/13808
This commit is contained in:
@@ -19,6 +19,8 @@ SOUP_LOG=/root/soup.log
|
|||||||
WHATWOULDYOUSAYYAHDOHERE=soup
|
WHATWOULDYOUSAYYAHDOHERE=soup
|
||||||
whiptail_title='Security Onion UPdater'
|
whiptail_title='Security Onion UPdater'
|
||||||
NOTIFYCUSTOMELASTICCONFIG=false
|
NOTIFYCUSTOMELASTICCONFIG=false
|
||||||
|
TOPFILE=/opt/so/saltstack/default/salt/top.sls
|
||||||
|
BACKUPTOPFILE=/opt/so/saltstack/default/salt/top.sls.backup
|
||||||
# used to display messages to the user at the end of soup
|
# used to display messages to the user at the end of soup
|
||||||
declare -a FINAL_MESSAGE_QUEUE=()
|
declare -a FINAL_MESSAGE_QUEUE=()
|
||||||
|
|
||||||
@@ -32,10 +34,7 @@ check_err() {
|
|||||||
if [[ $exit_code -ne 0 ]]; then
|
if [[ $exit_code -ne 0 ]]; then
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
systemctl_func "start" "$cron_service_name"
|
failed_soup_restore_items
|
||||||
systemctl_func "start" "salt-master"
|
|
||||||
systemctl_func "start" "salt-minion"
|
|
||||||
enable_highstate
|
|
||||||
|
|
||||||
printf '%s' "Soup failed with error $exit_code: "
|
printf '%s' "Soup failed with error $exit_code: "
|
||||||
case $exit_code in
|
case $exit_code in
|
||||||
@@ -347,8 +346,6 @@ highstate() {
|
|||||||
|
|
||||||
masterlock() {
|
masterlock() {
|
||||||
echo "Locking Salt Master"
|
echo "Locking Salt Master"
|
||||||
TOPFILE=/opt/so/saltstack/default/salt/top.sls
|
|
||||||
BACKUPTOPFILE=/opt/so/saltstack/default/salt/top.sls.backup
|
|
||||||
mv -v $TOPFILE $BACKUPTOPFILE
|
mv -v $TOPFILE $BACKUPTOPFILE
|
||||||
echo "base:" > $TOPFILE
|
echo "base:" > $TOPFILE
|
||||||
echo " $MINIONID:" >> $TOPFILE
|
echo " $MINIONID:" >> $TOPFILE
|
||||||
@@ -358,8 +355,12 @@ masterlock() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
masterunlock() {
|
masterunlock() {
|
||||||
echo "Unlocking Salt Master"
|
if [ -f $BACKUPTOPFILE ]; then
|
||||||
mv -v $BACKUPTOPFILE $TOPFILE
|
echo "Unlocking Salt Master"
|
||||||
|
mv -v $BACKUPTOPFILE $TOPFILE
|
||||||
|
else
|
||||||
|
echo "Salt Master does not need unlocked."
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
phases_pillar_2_4_80() {
|
phases_pillar_2_4_80() {
|
||||||
@@ -1091,6 +1092,16 @@ apply_hotfix() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
failed_soup_restore_items() {
|
||||||
|
local services=("$cron_service_name" "salt-master" "salt-minion")
|
||||||
|
for SERVICE_NAME in "${services[@]}"; do
|
||||||
|
if ! systemctl is-active --quiet "$SERVICE_NAME"; then
|
||||||
|
systemctl_func "start" "$SERVICE_NAME"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
enable_highstate
|
||||||
|
masterunlock
|
||||||
|
}
|
||||||
|
|
||||||
#upgrade salt to 3004.1
|
#upgrade salt to 3004.1
|
||||||
#2_3_10_hotfix_1() {
|
#2_3_10_hotfix_1() {
|
||||||
@@ -1130,6 +1141,8 @@ main() {
|
|||||||
echo ""
|
echo ""
|
||||||
require_manager
|
require_manager
|
||||||
|
|
||||||
|
failed_soup_restore_items
|
||||||
|
|
||||||
check_pillar_items
|
check_pillar_items
|
||||||
|
|
||||||
echo "Checking to see if this is an airgap install."
|
echo "Checking to see if this is an airgap install."
|
||||||
|
|||||||
Reference in New Issue
Block a user