From e00d2f4b080758f5b57ad3f8955dd38d2adf0538 Mon Sep 17 00:00:00 2001 From: Sebastian Schmittner Date: Wed, 19 Aug 2020 09:06:59 +0200 Subject: [PATCH] use python instead of xdd in alpine --- auto-hash-folder.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/auto-hash-folder.sh b/auto-hash-folder.sh index 2570464..6675a53 100755 --- a/auto-hash-folder.sh +++ b/auto-hash-folder.sh @@ -38,9 +38,10 @@ inotifywait -m $WHATCH_DIR -e create -e moved_to | if [[ "$POST_BINARY_URL" != "" ]]; then echo -e "[...]\t Posting binary hashes to $POST_BINARY_URL" while read -r line; do - echo -n "${line:14:64}" | xdd -r -p - | curl -i --data-binary "@-" $POST_BINARY_HEADERS $POST_BINARY_URL + python3 -c "import binascii; import sys; sys.stdout.buffer.write(binascii.unhexlify(\"${line:14:64}\"));" | \ + curl -i --data-binary "@-" $POST_BINARY_HEADERS $POST_BINARY_URL done <$out_file_path - echo -e "[ok]\t Hashes posted." + echo -e "[done]\t posted." fi else