zzz_evobackup: Make start_time and stop_time compatible with OpenBSD
This commit is contained in:
parent
5cbc2cbf42
commit
1efca713c0
|
@ -16,8 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
* Make start_time and stop_time compatible with OpenBSD
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
## [22.03]
|
## [22.03]
|
||||||
|
|
||||||
Split client and server parts of the project
|
Split client and server parts of the project
|
||||||
|
|
|
@ -505,8 +505,13 @@ fi
|
||||||
|
|
||||||
STOP_EPOCH=$(/bin/date +%s)
|
STOP_EPOCH=$(/bin/date +%s)
|
||||||
|
|
||||||
start_time=$(/bin/date --date="@${START_EPOCH}" +"${DATE_FORMAT}")
|
if [ "${SYSTEM}" = "openbsd" ]; then
|
||||||
stop_time=$(/bin/date --date="@${STOP_EPOCH}" +"${DATE_FORMAT}")
|
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 ))
|
duration=$(( STOP_EPOCH - START_EPOCH ))
|
||||||
|
|
||||||
log "STOP GLOBAL - start='${start_time}' stop='${stop_time}' duration=${duration}s"
|
log "STOP GLOBAL - start='${start_time}' stop='${stop_time}' duration=${duration}s"
|
||||||
|
|
Loading…
Reference in a new issue