[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 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