mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 09:42:46 +01:00
[fix] Only check log_size_limit on .2X -> .30
* Since we're showing a message in the middle of soup, wait for keypress if it's shown
This commit is contained in:
@@ -121,10 +121,13 @@ check_sudoers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_log_size_limit() {
|
check_log_size_limit() {
|
||||||
|
local wait_for_enter=false
|
||||||
|
|
||||||
local num_minion_pillars
|
local num_minion_pillars
|
||||||
num_minion_pillars=$(find /opt/so/saltstack/local/pillar/minions/ -type f | wc -l)
|
num_minion_pillars=$(find /opt/so/saltstack/local/pillar/minions/ -type f | wc -l)
|
||||||
|
|
||||||
if [[ $num_minion_pillars -gt 1 ]]; then
|
if [[ $num_minion_pillars -gt 1 ]]; then
|
||||||
|
wait_for_enter=true
|
||||||
echo "[INFO] The value of log_size_limit in the minion pillars may be incorrect."
|
echo "[INFO] The value of log_size_limit in the minion pillars may be incorrect."
|
||||||
echo " -> We recommend checking and adjusting the values as necessary."
|
echo " -> We recommend checking and adjusting the values as necessary."
|
||||||
else
|
else
|
||||||
@@ -166,9 +169,16 @@ check_log_size_limit() {
|
|||||||
new_limit=$( echo "$disk_size_gb" "$percent" | awk '{printf("%.0f", $1 * ($2/100))}')
|
new_limit=$( echo "$disk_size_gb" "$percent" | awk '{printf("%.0f", $1 * ($2/100))}')
|
||||||
|
|
||||||
if [[ $current_limit != "$new_limit" ]]; then
|
if [[ $current_limit != "$new_limit" ]]; then
|
||||||
|
wait_for_enter=true
|
||||||
echo "[WARNING] The value of log_size_limit (${current_limit}) does not match the recommended value of ${new_limit}."
|
echo "[WARNING] The value of log_size_limit (${current_limit}) does not match the recommended value of ${new_limit}."
|
||||||
echo " -> We recommend checking and adjusting the value as necessary."
|
echo " -> We recommend checking and adjusting the value as necessary."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $wait_for_enter == true ]]; then
|
||||||
|
echo ""
|
||||||
|
read -n 1 -s -r -p "Press any key to continue..."
|
||||||
|
echo "" # Since read doesn't print a newline, print one for it
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,6 +402,7 @@ up_2.3.2X_to_2.3.30() {
|
|||||||
for pillar in "${minion_pillars[@]}"; do
|
for pillar in "${minion_pillars[@]}"; do
|
||||||
sed -i -r "s/ (\{\{.*}})$/ '\1'/g" "$pillar"
|
sed -i -r "s/ (\{\{.*}})$/ '\1'/g" "$pillar"
|
||||||
done
|
done
|
||||||
|
check_log_size_limit
|
||||||
}
|
}
|
||||||
|
|
||||||
space_check() {
|
space_check() {
|
||||||
@@ -714,7 +725,7 @@ fi
|
|||||||
|
|
||||||
check_sudoers
|
check_sudoers
|
||||||
|
|
||||||
check_log_size_limit
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user