Unraid-SlackPack/source/md5tofile

13 lines
289 B
Plaintext
Raw Normal View History

2016-10-09 16:29:27 +00:00
#!/bin/bash
if [ $# -ne 1 ] ; then
echo "Usage $0 [directory]"
exit 1
fi
2016-10-09 23:45:46 +00:00
find $1 -type f -iname "*.txz" -print0 | while IFS= read -r -d $'\0' file; do
2016-10-09 16:29:27 +00:00
(
cd "$(dirname "$file")"
filename="$(basename "$file")"
md5sum "$filename" > "$filename".md5
)
2017-02-19 19:01:50 +00:00
done