marvvin

IRC bot
Log | Files | Refs | README | LICENSE

commit 4e81532194ae4b954af8dd5b8d6d86a8e97c9581
parent 6cbea940c62dce4f38c53c67c2cdffc1436423fc
Author: hhvn <dev@hhvn.uk>
Date:   Mon, 24 May 2021 23:34:03 +0100

functions.sh: use $tmpdir/timeout for timeout()

Diffstat:
Mfunctions.sh | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/functions.sh b/functions.sh @@ -53,7 +53,8 @@ match_raw(){ # timeout(time, command) timeout(){ stdin=$(cat) - tmpfile="$tmpdir/$(printf '%s%s\n' "$(date +%s)" "$(head -n 1 /dev/urandom | base64 | head -n 1 | cut -c-10)" | tr '/' '%')" + mkdir -p "$tmpdir/timeout" + tmpfile="$tmpdir/timeout/$(printf '%s%s\n' "$(date +%s)" "$(head -n 1 /dev/urandom | base64 | head -n 1 | cut -c-10)" | tr '/' '%')" time="$1" shift