From 1efca713c0e5c5df5fb243fa6ebde72f2657d697 Mon Sep 17 00:00:00 2001 From: Jeremy Dubois Date: Wed, 13 Apr 2022 17:08:38 +0200 Subject: [PATCH] zzz_evobackup: Make start_time and stop_time compatible with OpenBSD --- client/CHANGELOG.md | 4 +++- client/zzz_evobackup | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/CHANGELOG.md b/client/CHANGELOG.md index 8dc9a9a..1221d36 100644 --- a/client/CHANGELOG.md +++ b/client/CHANGELOG.md @@ -16,8 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +* Make start_time and stop_time compatible with OpenBSD + ### Security ## [22.03] -Split client and server parts of the project \ No newline at end of file +Split client and server parts of the project diff --git a/client/zzz_evobackup b/client/zzz_evobackup index 20b619c..09234d2 100755 --- a/client/zzz_evobackup +++ b/client/zzz_evobackup @@ -505,8 +505,13 @@ fi STOP_EPOCH=$(/bin/date +%s) -start_time=$(/bin/date --date="@${START_EPOCH}" +"${DATE_FORMAT}") -stop_time=$(/bin/date --date="@${STOP_EPOCH}" +"${DATE_FORMAT}") +if [ "${SYSTEM}" = "openbsd" ]; then + start_time=$(/bin/date -f "%s" -j "${START_EPOCH}" +"${DATE_FORMAT}") + stop_time=$(/bin/date -f "%s" -j "${STOP_EPOCH}" +"${DATE_FORMAT}") +else + start_time=$(/bin/date --date="@${START_EPOCH}" +"${DATE_FORMAT}") + stop_time=$(/bin/date --date="@${STOP_EPOCH}" +"${DATE_FORMAT}") +fi duration=$(( STOP_EPOCH - START_EPOCH )) log "STOP GLOBAL - start='${start_time}' stop='${stop_time}' duration=${duration}s"