From fc3171ae5e8ee9cd5e687997855800e358721b1a Mon Sep 17 00:00:00 2001 From: Lucas Date: Sat, 30 Jul 2022 14:45:04 +0000 Subject: [PATCH] sekrit: use timeout in cp if present --- bin/sekrit.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/sekrit.sh b/bin/sekrit.sh index 63ddc4e..7b6a0b0 100644 --- a/bin/sekrit.sh +++ b/bin/sekrit.sh @@ -109,8 +109,14 @@ sekrit_cp() key=$1 path=$(make_key_path "$key") [ -f "$path" ] || err "no data for key $key" + + timo= + if command -v timeout >/dev/null 2>&1; then + timo="timeout 10" + fi + _sekrit_decrypt "$path" | - xclip $rmlastnl -loops 1 -quiet -selection clip 2>/dev/null + $timo xclip $rmlastnl -loops 1 -quiet -selection clip 2>/dev/null } sekrit_gen()