Skip to content

Commit

Permalink
use python instead of xdd in alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
Echsecutor committed Aug 19, 2020
1 parent 1088443 commit e00d2f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions auto-hash-folder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e00d2f4

Please sign in to comment.