struct(tools): checksum generator script
This commit is contained in:
parent
a6107f7e25
commit
16f302c3fd
28
devUtils/generateHelperChecksums.sh
Normal file
28
devUtils/generateHelperChecksums.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# generate checksums from provided path suitable for use by 'update.sh'
|
||||||
|
#
|
||||||
|
|
||||||
|
# check for missing path to helper files, otherwise strip trailing slash
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
printf "\nPlease supply path to helper files. Exiting.\n\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
srcDir="${1%/}"
|
||||||
|
|
||||||
|
# verify path exists and is accessible
|
||||||
|
if ! [ -d "$srcDir" ]; then
|
||||||
|
printf "\nUnable to find or read supplied path to helper files. Exiting.\n\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# generate checksum file
|
||||||
|
\rm -f "${srcDir}/checksums.sha256"
|
||||||
|
find "${srcDir}/" -type f -exec sha256sum {} + >>"${srcDir}/checksums.sha256"
|
||||||
|
sed -i "s+$srcDir/++g" "${srcDir}/checksums.sha256"
|
||||||
|
|
||||||
|
# exit gracefully
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
#EOF
|
Loading…
Reference in New Issue
Block a user