26 lines
474 B
Bash
26 lines
474 B
Bash
checksum_create()
|
|
{
|
|
if [[ -f .checksum ]]; then
|
|
echo -e "${color_bred}Checksum already exists.${color_default}"
|
|
return 1
|
|
fi
|
|
|
|
find -type f | parallel -- sha1sum {} >> .checksum
|
|
sed -i "/\.checksum/d" .checksum
|
|
}
|
|
|
|
checksum_check()
|
|
{
|
|
sha1sum --quiet -c .checksum
|
|
}
|
|
|
|
checksum_update()
|
|
{
|
|
if [[ ! -f .checksum ]]; then
|
|
echo -e "${color_bred}Checksum doesn't exists.${color_default}"
|
|
return 1
|
|
fi
|
|
|
|
checksum_check && rm .checksum && checksum_create
|
|
}
|