[fix] reboot error fix

This commit is contained in:
William Wernert
2020-05-12 17:52:44 -04:00
parent cb69edc6dd
commit 08007a491f

View File

@@ -91,13 +91,13 @@ wait_for_file() {
local date
date=$(date)
while [[ $cur_attempts < $max_attempts ]]; do
while [[ $cur_attempts -lt $max_attempts ]]; do
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
else
echo "File $filename does not exist; waiting ${wait_interval}s then checking again ($cur_attempts/$max_attempts)..." >> "$setup_log" 2>&1
((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"
fi
done
@@ -195,11 +195,10 @@ check_admin_pass() {
check_hive_init_then_reboot() {
local return_val
return_val="$(wait_for_file /opt/so/state/thehive.txt 20 5)"
if [[ "$return_val" != 0 ]]; then
return "$return_val"
wait_for_file /opt/so/state/thehive.txt 20 5
local return_val=$?
if [[ $return_val -ne 0 ]]; then
return $return_val
fi
docker stop so-thehive