mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-28 11:25:20 +01:00
13 lines
408 B
Bash
Executable File
13 lines
408 B
Bash
Executable File
#!/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[@]}"
|