2021-07-27 17:08:55 -06:00
|
|
|
#!/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"
|
2021-07-27 21:48:45 -06:00
|
|
|
find "${srcDir}/" -type f -exec sha256sum {} + >>./checksums.sha256
|
|
|
|
sed -i "s+$srcDir/++g" ./checksums.sha256
|
|
|
|
\mv ./checksums.sha256 "${srcDir}/"
|
2021-07-27 17:08:55 -06:00
|
|
|
|
|
|
|
# exit gracefully
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
#EOF
|