mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-22 00:43:09 +01:00
[fix] reboot error fix
This commit is contained in:
@@ -91,13 +91,13 @@ wait_for_file() {
|
|||||||
local date
|
local date
|
||||||
date=$(date)
|
date=$(date)
|
||||||
|
|
||||||
while [[ $cur_attempts < $max_attempts ]]; do
|
while [[ $cur_attempts -lt $max_attempts ]]; do
|
||||||
if [ -f "$filename" ]; then
|
if [ -f "$filename" ]; then
|
||||||
echo "File $filename already exists at $date" >> "$setup_log" 2>&1
|
echo "File $filename found at $date" >> "$setup_log" 2>&1
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
echo "File $filename does not exist; waiting ${wait_interval}s then checking again ($cur_attempts/$max_attempts)..." >> "$setup_log" 2>&1
|
|
||||||
((cur_attempts++))
|
((cur_attempts++))
|
||||||
|
echo "File $filename does not exist; waiting ${wait_interval}s then checking again ($cur_attempts/$max_attempts)..." >> "$setup_log" 2>&1
|
||||||
sleep "$wait_interval"
|
sleep "$wait_interval"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -195,11 +195,10 @@ check_admin_pass() {
|
|||||||
|
|
||||||
check_hive_init_then_reboot() {
|
check_hive_init_then_reboot() {
|
||||||
|
|
||||||
local return_val
|
wait_for_file /opt/so/state/thehive.txt 20 5
|
||||||
return_val="$(wait_for_file /opt/so/state/thehive.txt 20 5)"
|
local return_val=$?
|
||||||
|
if [[ $return_val -ne 0 ]]; then
|
||||||
if [[ "$return_val" != 0 ]]; then
|
return $return_val
|
||||||
return "$return_val"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker stop so-thehive
|
docker stop so-thehive
|
||||||
|
|||||||
Reference in New Issue
Block a user