2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[#1611] make date +%s -d 4 seconds work on alpine

This commit is contained in:
Andrei Pavel
2020-12-14 19:12:25 +02:00
parent 3ed001b29d
commit 72c0a679a1

View File

@@ -423,8 +423,8 @@ get_process_name() {
# Wait for file to be created.
wait_for_file() {
local file=${1}
timeout='4 seconds'
deadline=$(date +%s -d "${timeout}")
timeout='4' # seconds
deadline=$(($(date +%s) + timeout))
while ! test -f "${file}"; do
if test "${deadline}" -lt "$(date +%s)"; then
# Time is up.
@@ -439,8 +439,8 @@ wait_for_file() {
# Wait for process identified by PID to die.
wait_for_process_to_die() {
local pid=${1}
timeout='4 seconds'
deadline=$(date +%s -d "${timeout}")
timeout='4' # seconds
deadline=$(($(date +%s) + timeout))
while ps "${pid}" >/dev/null; do
if test "${deadline}" -lt "$(date +%s)"; then
# Time is up.