hosts: wait 15 minutes before first reboot
This commit is contained in:
parent
5e2dd277fd
commit
2b7c629304
1 changed files with 3 additions and 3 deletions
|
@ -30,11 +30,11 @@ in
|
||||||
currentTime=$(date +%s)
|
currentTime=$(date +%s)
|
||||||
lastScheduledTime=$(consul kv get system/coordinated-reboot/last)
|
lastScheduledTime=$(consul kv get system/coordinated-reboot/last)
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
lastScheduledTime=$((currentTime - 300))
|
lastScheduledTime=$((currentTime - 900))
|
||||||
fi
|
fi
|
||||||
nextScheduledTime=$((lastScheduledTime + 3600))
|
nextScheduledTime=$((lastScheduledTime + 3600))
|
||||||
if [[ $nextScheduledTime -lt $((currentTime + 300)) ]]; then
|
if [[ $nextScheduledTime -lt $((currentTime + 900)) ]]; then
|
||||||
nextScheduledTime=$((currentTime + 300))
|
nextScheduledTime=$((currentTime + 900))
|
||||||
fi
|
fi
|
||||||
consul kv put system/coordinated-reboot/last $nextScheduledTime
|
consul kv put system/coordinated-reboot/last $nextScheduledTime
|
||||||
echo "Scheduling reboot for $nextScheduledTime"
|
echo "Scheduling reboot for $nextScheduledTime"
|
||||||
|
|
Loading…
Reference in a new issue