mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-25 01:44:43 +01:00
13 lines
408 B
Plaintext
13 lines
408 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
set -eu
|
||
|
args=("$@")
|
||
|
|
||
|
if [ -n "$ZREPL_MOCK_ZFS_COMMAND_LOG" ]; then
|
||
|
(
|
||
|
flock -x 200
|
||
|
jq --compact-output -n --argjson args "$(printf '%s\0' "${args[@]}" | jq -Rsc 'split("\u0000")')" '{date: now|strflocaltime("%Y-%m-%dT%H:%M:%S"), command: $args}' >> "$ZREPL_MOCK_ZFS_COMMAND_LOG"
|
||
|
) 200>"$ZREPL_MOCK_ZFS_COMMAND_LOG".lock
|
||
|
fi
|
||
|
|
||
|
exec "$ZREPL_MOCK_ZFS_PATH" "${args[@]}"
|